Skip to content

Instantly share code, notes, and snippets.

@jackfuchs
jackfuchs / jquery.support.cssproperty.js
Last active January 13, 2024 16:07
Extends the jQuery.support object to CSS Properties
/**
* jQuery.support.cssProperty
* To verify that a CSS property is supported
* (or any of its browser-specific implementations)
*
* @param p css property name
* @param rp optional, if set to true, the css property name will be returned
* instead of a boolean support indicator
* @return {mixed}
*
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// 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'];
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
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"
@rodw
rodw / backup-github.sh
Last active March 30, 2024 15:04
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
#-------------------------------------------------------------------------------
# NOTES:
#-------------------------------------------------------------------------------
# * Under the heading "CONFIG" below you'll find a number of configuration
# parameters that must be personalized for your GitHub account and org.
# Replace the `<CHANGE-ME>` strings with the value described in the comments
# (or overwrite those values at run-time by providing environment variables).
@fat
fat / gist:3744339
Created September 18, 2012 17:06
normalize jacob's iphone :P
/*! normalize-mobile.css v1.0.0 | MIT License */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/*
* Prevents modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@hlb
hlb / erb.sublime-completions
Created August 20, 2013 03:07
Sublime Text 2/Packages/User/erb.sublime-completions
{
"scope": "text.html.ruby source.ruby.rails.embedded.html",
"completions":
[
{ "trigger": "lorem_image", "contents": "lorem_image('$1', :random_color => true)" },
{ "trigger": "lorem_email", "contents": "lorem_email" },
{ "trigger": "lorem_date", "contents": "lorem_date" },
{ "trigger": "lorem_name", "contents": "lorem_name" },
@wastemobile
wastemobile / gist:7268456
Last active December 27, 2015 04:39
據說 AngularJS 頁面若是被 IE8 以下的瀏覽器摸到,因為對 JSON 支援不足的緣故,會整個 View Template 直接秀出來,必須改用下面的寫法。IE 果真是網路的殺手啊~
<html ng-app id="ng-app" class="ng-app">
<head runat="server">
<title></title>
<!--[if lte IE 8]>
<script src="http://cdnjs.cloudflare.com/ajax/libs/json3/3.2.5/json3.min.js"></script>
We couldn’t find that file to show.