Skip to content

Instantly share code, notes, and snippets.

Jamie York ziadoz

View GitHub Profile
View CSS3 Media Queries Template
/*
* Author: http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
@mrdoob
mrdoob / RequestAnimationFrame.js
Created Feb 22, 2011
Provides requestAnimationFrame in a cross browser way.
View RequestAnimationFrame.js
/**
* Provides requestAnimationFrame in a cross browser way.
* @author paulirish / http://paulirish.com/
*/
if ( !window.requestAnimationFrame ) {
window.requestAnimationFrame = ( function() {
return window.webkitRequestAnimationFrame ||
@marcoarment
marcoarment / Bcrypt.php
Created Jun 29, 2011
Simple PHP 5.3+ Bcrypt class and functions
View Bcrypt.php
<?php
/*
By Marco Arment <me@marco.org>.
This code is released in the public domain.
THERE IS ABSOLUTELY NO WARRANTY.
Usage example:
// In a registration or password-change form:
@lukas-vlcek
lukas-vlcek / gist:1075067
Created Jul 10, 2011
Test of attachments plugin
View gist:1075067
#!/bin/sh
host=localhost:9200
curl -X DELETE "${host}/test"
curl -X PUT "${host}/test" -d '{
"settings" : { "index" : { "number_of_shards" : 1, "number_of_replicas" : 0 }}
}'
@jt
jt / merge.md
Created Aug 23, 2011
Merge a forked gist
View merge.md

If someone forks a gist and you'd like to merge their changes. Do this:

  1. clone your repo, I use the name of the gist

     git clone git://gist.github.com/1163142.git gist-1163142
    
  2. add a remote for the forked gist, I'm using the name of my fellow developer

     git remote add aaron git://gist.github.com/1164196.git
    
@CHH
CHH / MetaObject.php
Created Aug 30, 2011
PHP does Meta Programming too! (Requires PHP 5.4)
View MetaObject.php
<?php
namespace CHH;
trait MetaObject
{
protected static $__metaClass;
static function setMetaClass(MetaClass $metaClass)
{
@rtomayko
rtomayko / optparse-template.rb
Last active Jan 19, 2020
Ruby optparse template
View optparse-template.rb
#!/usr/bin/env ruby
#/ Usage: <progname> [options]...
#/ How does this script make my life easier?
# ** Tip: use #/ lines to define the --help usage message.
$stderr.sync = true
require 'optparse'
# default options
flag = false
option = "default value"
@paulirish
paulirish / rAF.js
Last active Jul 2, 2020
requestAnimationFrame polyfill
View rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@bjhess
bjhess / st_cheat.txt
Created Jan 11, 2012
Sublime Text Cheatsheet
View st_cheat.txt
Navigation:
cmd-p Goto Anything ('@' for functions, ':' for line number)
cmd-r Function finder
ctl-g Goto line number
cmd-sft-p Command palette
cmd-sft-f Find in Files
cmd-opt-r Toggle regex when finding
cmd-opt-# Columns
ctr-# Switch columns
@ziadoz
ziadoz / awesome-php.md
Last active May 20, 2020
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
View awesome-php.md
You can’t perform that action at this time.