This file contains hidden or 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
;; Load .zshrc (of course I am very interested in a better method) | |
(let ((path (shell-command-to-string ". ~/.zshrc; echo -n $PATH"))) | |
(setenv "PATH" path) | |
(setq exec-path | |
(append | |
(split-string-and-unquote path ":") | |
exec-path))) |
This file contains hidden or 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 fs = require('fs'); | |
var assert = require("assert"); | |
// Example 1 ----------------------------------------- // | |
var myDomain = "www.nhunzaker.com/this_article"; | |
assert( myDomain.match("nhunzaker.com") ); | |
This file contains hidden or 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
// Viewport | |
// | |
// phantom.js viewport.js http://google.com 400 | |
var args = require("system").args; | |
var url = args[1]; | |
var width = args[2]; | |
var height = args[3]; |
This file contains hidden or 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() { | |
var color = Mocha.reporters.Base.color; | |
function log() { | |
var args = Array.apply(null, arguments); | |
if (window.callPhantom) { | |
window.callPhantom({ message: args.join(" ") }); |
This file contains hidden or 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 set_grid ($items) { | |
$items.removeClass("omega").each(function() { | |
var slot = $(this).index() + 1; | |
if ( slot % 3 === 0) { | |
$(this).addClass("omega"); | |
} | |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
// A simple struct, we'll use "PersonStruct" | |
// for clarity | |
struct PersonStruct | |
{ | |
char *name; | |
int age; |
This file contains hidden or 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
source 'https://rubygems.org' | |
gem 'rails', '3.2.8' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' | |
This file contains hidden or 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
// Ender stores underscore under "_". So we do.... | |
$._.templateSettings = { | |
interpolate: /\<\@\=(.+?)\@\>/gim, | |
evaluate: /\<\@(.+?)\@\>/gim | |
}; |
This file contains hidden or 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
/* | |
TIME BASED ANIMATION: | |
--------------------- | |
To keep things moving at a constant time-based rate instead of varying | |
frame-based, multiply your movement by APP.deltaTime | |
BAD: 100 pixels per frame (BOO... movement is tied to framerate) | |
var velocity = 100; | |
BETTER: 100 pixels per second (Horray! Framerate independence!) |
This file contains hidden or 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 preCanvas = document.createElement("canvas"), | |
preContext = preCanvas.getContext("2d"); | |
preContext.fillRect(0,0,150,150); | |
preContext.save() | |
var canvas = document.getElementById("otherCanvas"), | |
context = canvas.getContext('2d') | |
context.drawImage(preCanvas, 0, 0); |