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
<!doctype html> | |
<html lang="en-us"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Orientation Test</title> | |
<style> | |
body { text-align: center; } | |
@media all and (orientation:portrait) { | |
body { font-size: 35em; margin-top: .3em; } | |
} |
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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
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
# this came from jtaby http://www.slideshare.net/jtaby/tools-and-techniques-for-faster-development slide 94 | |
alias gl="git log --graph --pretty=format:'%Cred%h%Creset %C(cyan)%an%Creset - %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" |
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
#!/bin/bash | |
$ git push | |
Counting objects: 5, done. | |
Delta compression using up to 8 threads. | |
Compressing objects: 100% (3/3), done. | |
Writing objects: 100% (3/3), 324 bytes, done. | |
Total 3 (delta 2), reused 0 (delta 0) | |
remote: % Total % Received % Xferd Average Speed Time Time Time Current | |
remote: Dload Upload Total Spent Left Speed |
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
// things you should be able to know from javascript, according to Dmitry Baranovskiy - http://www.youtube.com/watch?v=Trr95ij1358 | |
5 - "4"; | |
5 + "4"; | |
+!{}[true] | |
+[1] | |
+[1,2] | |
7 - "a" | |
7 / 0 |
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
var operands = "", operation = ""; for (var i = 0; i < 10; i++) { operands += "- + "; operation = '1 + ' + operands + '1'; console.log(operation + ": " + eval(operation) ); } | |
/* | |
1 + - + 1: 0 | |
1 + - + - + 1: 2 | |
1 + - + - + - + 1: 0 | |
1 + - + - + - + - + 1: 2 | |
1 + - + - + - + - + - + 1: 0 | |
1 + - + - + - + - + - + - + 1: 2 | |
1 + - + - + - + - + - + - + - + 1: 0 |
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
#!upstart | |
description "node.js enhancement_renderer" | |
author "john weis" | |
start on startup | |
stop on shutdown | |
script | |
export HOME="/root" |
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
# Start an HTTP server from a directory, optionally specifying the port | |
function server() { | |
local port="${1:-8888}" | |
open "http://localhost:${port}/" | |
# Set the default Content-Type to `text/plain` instead of `application/octet-stream` | |
# And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files) | |
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port" | |
} |
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
function test_pntdrrn_regex(pattern, sample, dividend, divisor) { | |
console.log( | |
dividend + "/" + divisor + "\t\t" + | |
pattern.toString() + | |
( pattern.test(sample) ? "" : " doesn't" ) + " match" + | |
( pattern.test(sample) ? "es " : " " ) + | |
"`" + sample + "`" | |
); | |
} |
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
mkdir -p ~/src && cd ~/src | |
git clone git://github.com/joyent/node.git | |
cd node | |
./configure | |
make | |
make install |