Skip to content

Instantly share code, notes, and snippets.

View ginader's full-sized avatar

Dirk Ginader ginader

View GitHub Profile
@insin
insin / Google Closure.sublime-build (Linux)
Created December 22, 2011 01:06
Google Closure Compiler build for Sublime Text 2
{
"cmd": ["java", "-jar", "${packages}/Google Closure/compiler.jar", "--js", "$file", "--js_output_file", "/dev/null", "--compilation_level", "WHITESPACE_ONLY"],
"file_regex": "^(.*):([0-9]+):() ERROR - (.*)",
"selector": "source.js"
}
@nzakas
nzakas / namespace.js
Created December 6, 2011 19:14
A single global with a namespace method
//BSD Licensed
var YourGlobal = {
namespace: function(ns){
var parts = ns.split("."),
object = this,
i, len;
for (i=0, len=parts.length; i < len; i++) {
if (!object[parts[i]]) {
@scottkellum
scottkellum / normalized.html
Created December 6, 2011 14:58
pixel normalization
<!doctype html>
<html>
<head>
<!-- Encoding -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>
@BenWard
BenWard / scrobblejam.js
Created November 27, 2011 01:25
Scrobble my Jam: A pre-configured, bookmarklet version of Scrobble my Jam ready for use. Scrobbles playback from http://thisismyjam.com to http://last.fm. Enjoy.
/* Scrobble my Jam
*
* Bookmarklet JavaScript for scrobbling http://thisismyjam.com to
* Last.FM. If it doesn't scrobble, it doesn't count.
*
* (c) 2011 Ben Ward (@benward, http://benward.me)
*
* BSD License
*
* Instructions: Select all of the JavaScript text below, and drag it to your bookmarks
@nimbupani
nimbupani / HTML language
Created November 22, 2011 17:00 — forked from kornelski/HTML language
TextMate HTML language tweaked to support unquoted attributes
{ scopeName = 'text.html.basic';
firstLineMatch = '<!DOCTYPE|doctype<(?i:html)|<\?(?i:php)';
fileTypes = ( 'html', 'htm', 'shtml', 'xhtml', 'phtml', 'php', 'inc', 'tmpl', 'tpl', 'ctp' );
foldingStartMarker = '(?x)
(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl|section|article|header|footer|nav|aside)\b.*?>
|<!--(?!.*--\s*>)
|^<!--\ \#tminclude\ (?>.*?-->)$
|<\?(?:php)?.*\b(if|for(each)?|while)\b.+:
|\{\{?(if|foreach|capture|literal|foreach|php|section|strip)
|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
@paulirish
paulirish / data-markdown.user.js
Last active October 22, 2024 14:19
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@textarcana
textarcana / git-log2json.sh
Last active January 24, 2025 22:12
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@reid
reid / move.html
Created October 12, 2011 22:47
Source of https://www.me.com/move while logged in.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- IMPORTANT NOTE: This file is licensed only for use in providing the MobileMe service,
or any part thereof, and is subject to the MobileMe Terms and Conditions. You may not
port this file to another platform without Apple's written consent. -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
@rgrove
rgrove / gist:1265810
Created October 5, 2011 21:33
Better Y.throttle()
// New Y.throttle().
Y.throttle = function (fn, duration, context) {
var lastTime = 0,
lastArgs, timeout;
duration || (duration = Y.config.throttleTime || 150);
function execute() {
var args = lastArgs;
yeti --connected
yeti info - checking for connected clients..
yeti info - clients closed: 11
yeti info - clients connected: 23
yeti info - clients open: 23
yeti info - browsers connected:
--------------------------------------------------------------------------------------------
| Browser | OS | IP |
--------------------------------------------------------------------------------------------
| Chrome (14.0.835.186) | Mac OS | 10.0.1.50 |