JavaScript libraries

12/15/15  Public, Other Languages

https://lodash.com/
- A JavaScript utility library delivering consistency, modularity, performance, & extras.

http://momentjs.com/
- Parse, validate, manipulate, and display dates in JavaScript.

http://underscorejs.org/
- Underscore is a ...

1 vote - harrylevine

Ruby Case statement (aka Switch statement)

11/20/15  Public, Ruby General

Standard Case

print "Enter your grade: "
grade = gets.chomp
case grade
when "A"
  puts 'Well done!'
when "B"
  puts 'Try harder!'
when "C"
  puts 'You need help!!!'
else
  puts "You just making it up!"
end

Mult...

1 vote - harrylevine

Sharing your GitHub SSH public key

10/16/15  Public, Git

Check if you have an SSH key by calling $ ls -al ~/.ssh. If you have these in there:

id_rsa
id_rsa.pub

Then continue on. If not, follow the steps in the link at the bottom of the page.

1 - In your terminal, go to the root ...

1 vote - harrylevine

How to show & hide hidden dot (.) files in the Mac Finder window

10/15/15  Public, Command Line

1 - In Terminal, enter $ defaults write com.apple.finder AppleShowAllFiles YES
2 - Press return
3 - Hold the ‘Option/alt’ key, then right click on the Finder icon in the dock and click Relaunch.

To hide them, repeat the above steps, expect ...

1 vote - harrylevine

Change remote Git URL after forking a repository

10/13/15  Public, Git

After you have forked and cloned the repository:

$ cd into-the-repository
$ git remote set-url origin https://github.com/username/repo-name.git

So for example, if your GitHub username is hpjaj, and the repo is holo-alfa, h...

1 vote - harrylevine

How the ruby Tap method works

10/09/15  Public, Ruby General

First, let's define a couple of terms: caller and mutated.

The caller is what tap is being called on. In the below, the caller is arr:

arr = [2, 3, 1]
arr.tap do |x|
  x.sort
end

Mutated permanently change...

1 vote - harrylevine

Sublime text shortcut for moving whole line up or down

10/03/15  Public, Shortcuts

On a mac:

command + control + up-arrow

command + control + down-arrow

1 vote - harrylevine

Add all Google Fonts to Sketch 3

10/03/15  Public, Online Resources

From: http://www.sketchappsources.com/blog/post/how-to-solve-missing-fonts-in-sketch-app

All you have to do is paste the code below into Terminal:

curl https://raw.githubusercontent.com/qrpike/Web-Font-Load/master/install.sh | sh

If yo...

1 vote - harrylevine

In a controller spec, calling a PUT or POST action

09/18/15  Public, Testing / TDD

From users_controller_spec.rb:

put :update, :id => user.id, :user => { :active => false }

1 vote - harrylevine