- delete a word backword -
ctrl + w
- move between words
- move back one word:
ESC + b
- move forward one word:
ESC + f
- terminal only !(iTerm):
- move back one word:
option + left-right-arrow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://codegolf.stackexchange.com/questions/2682/tips-for-golfing-in-javascript?lq=1 | |
var test = "hw"; | |
(() => test)(); // >> "hw" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## list all local and remote branches | |
git branch -a | |
## list only remote branches | |
git branch -r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -a lets you pass an application name to open with | |
open -a TextEdit ~/path/to/foo.txt | |
# -e will open the file in TextEdit | |
open -e ~/path/to/foo.txt | |
# -t opens the file with the default text editor | |
open -t ~/path/to/foo.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a, b = 1, 2 | |
a &= b | |
# is the same as | |
a = a & b | |
# does a bitwise `and` | |
x = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = "foo" | |
# => :foo | |
x == :foo | |
# => true | |
x = @foo | |
# => @foo | |
x.to_sym | |
# => :@foo | |
x == :@foo | |
# => true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# returns last index of occurance | |
s = "marcus shepherd" | |
x = s.rindex(" ") | |
# => 6 | |
s[0..x-1] | |
# => "marcus" | |
s[x+1..s.length] | |
# => "shepherd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# returns the first element that returns `true` after being passed to `block` | |
x = [1, 2, 3] | |
x = x.detect{|i| i > 1} | |
# => 2 | |
x == 2 | |
# => true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@-moz-document url-prefix(){ | |
.foo{ | |
color: blue; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DateCreatedAndUpdate(models.Model): | |
""" | |
Abstract class used to populate childern with a `date_created` field | |
""" | |
class Meta: | |
abstract, ordering = True, ("-id",) | |
date_created = models.DateTimeField(auto_now_add=True) | |
date_updated = models.DateTimeField(auto_now=True) | |
def time_past_since_creation(self): |