When a beginner asks you "when do I use semi-colons?" would you rather say this?
// what people who say "use semicolons!!" say
class Foo {
prop = {
}; // yes
When a beginner asks you "when do I use semi-colons?" would you rather say this?
// what people who say "use semicolons!!" say
class Foo {
prop = {
}; // yes
# MAC manipulators | |
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`' | |
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE' |
##Simply annoying Tweets
Annoyingly extended words (4+ of the same letter in a phrase): OOOOHHHHMMMMYYYYGGGGOOOODDDD
([a-z])/1{4}
Tweet w/ just a single hashtag: #omgthissucks
^ *#[^ ]+$
/* | |
* grunt-subgrunt | |
* http://gruntjs.com/ | |
* | |
* Copyright (c) 2012 "Cowboy" Ben Alman | |
* Licensed under the MIT license. | |
* https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT | |
*/ | |
'use strict'; |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
width = 102 # width of rectangle | |
height = 40 # height of rectangle | |
pos_x = 3 # x coordinate for entire grid | |
pos_y = 3 # y coordinate for entire grid | |
y_margin = 3 # vertical space between rectangles | |
x_margin = 3 # horizontal space between rectangles | |
columns = 3 # number of columns | |
rows = 5 # number of rows | |
columns.times do |col| # number of columns |
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES; | |
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled; | |
// by the way, you need to logout and log back in for this to take effect. Or at least that's what | |
// Quartz Debug says. Who knows, maybe it's lying? | |
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging | |
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from. |
var fs = require("fs"); | |
var jParser = require("jParser"); | |
var eof = false; | |
fs.readFile("sample.jpg",function(err,data) { | |
if (!err) { | |
var view = new jDataView(data, undefined, undefined, false); | |
var parser = new jParser(view,{ | |
// JPG |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |