Skip to content

Instantly share code, notes, and snippets.

View iTonyYo's full-sized avatar
🎯
Focusing

Whoami iTonyYo

🎯
Focusing
  • California
View GitHub Profile
function inferInputModel() {
if (window.navigator.msPointerEnabled) {
return 'pointer';
} else if (window.ontouchstart !== undefined) {
return 'touch';
} else {
return 'unknown';
}
}
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your location block(s):
#
# include cors_support;
#
# For more information on CORS, please see: http://enable-cors.org/

Creating a bootable OS X Mavericks USB installer

  • First, plug in an 8GB (or bigger) USB drive, and use Disk Utility to erase it
  • If you use the default settings, you should wind up with a blank drive at /Volumes/Untitled.

With that volume in place, and with the Mavericks installer sitting in /Applications/Install\ OS\ X\ Mavericks.app, run the following command in your terminal to create a bootable install media:

sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction
@iTonyYo
iTonyYo / list.md
Created October 27, 2013 07:21 — forked from robotlolita/list.md

Meta-Programming

  • Towards a fully-reflective meta-programming language (G. Neverov, P. Roe)
  • D-Expressions: Lisp Power, Dylan Style (J. Bachrach, K. Playford)
  • The Java Syntactic Extender (J. Bachrach, K. Playford)
  • Template Meta-Programming for Haskell (T. Sheard, S.P. Jones)
  • First-class macros have types (A. Bawden)
  • Macros that work (W. Clinger, J. Rees)
  • Macros as multi-stage computations: type-safe, generative, binding macros in MacroML (S.E. Ganz, A. Sabry, W. Taha)
  • Hygienic macro expansion (E. Kohlbecker, D. Friedman, M. felleisen, B. Duba)

How to get a free StartSSL.com SSL certificate

I'm writing this up from memory, so errors may appear.

Start

  1. Go to http://www.startssl.com/
  2. Click on 'Control Panel'
  3. Click 'Express Lane'
@iTonyYo
iTonyYo / git.txt
Created October 27, 2013 07:29 — forked from bumi/git.txt
* http://www.youtube.com/user/GitHubGuides/videos - github video guides
* http://gitimmersion.com/ - a guided tour that walks through the fundamentals of git.
* http://try.github.io/ - an interactive git tutorial to try and learn the basic git commands
* http://training.github.com/ - the github training page. they offer free git webinars
* https://www.codeschool.com/courses/git-real - git course on code school. great interactive course by the codeschool peeps.
* http://opentechschool.github.io/social-coding/ - the opentechschool course
* http://rogerdudler.github.io/git-guide/ - another simple and short git guide
* http://think-like-a-git.net/ - think like a git
* http://git-scm.com/book - full book about git. if you want to learn everything
* http://git-scm.com/book/en/Getting-Started-Git-Basics - a more technical introduction
@iTonyYo
iTonyYo / server.js
Created January 14, 2014 11:53 — forked from Hogent/server.js
// server.js
...
app.get("/notesapp.appcache", function(req, res){
res.header("Content-Type", "text/cache-manifest");
res.end("CACHE MANIFEST");
});
...
umd(function(require, exports, module) {
//...
},'my-module');function umd(fn,n){
if(typeof define=='function')return define(fn); // AMD
if(typeof module=='object')return fn(require,exports,module); // CommonJS
var m={exports:{}};window[n]=fn(function(n){return window[n];},m.exports,m)||m.exports; // window
}