This file contains 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
try{new CustomEvent('?')}catch(o_O){ | |
/*!(C) Andrea Giammarchi -- WTFPL License*/ | |
this.CustomEvent = function( | |
eventName, | |
defaultInitDict | |
){ | |
// the infamous substitute | |
function CustomEvent(type, eventInitDict) { | |
var event = document.createEvent(eventName); |
This file contains 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
$ casperjs event.js | |
[info] [phantom] Starting... | |
[info] [phantom] Running suite: 3 steps | |
[debug] [phantom] Successfully injected Casper client-side utilities | |
[info] [phantom] Step 2/3 file:///Users/niko/Sites/casperjs/test.html (HTTP 0) | |
[debug] [phantom] start page is loaded | |
[info] [phantom] Step 2/3: done in 207ms. | |
[info] [phantom] Step 3/3 file:///Users/niko/Sites/casperjs/test.html (HTTP 0) | |
[info] [phantom] Step 3/3: done in 310ms. | |
[info] [phantom] Done 3 steps in 406ms |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE language SYSTEM "language.dtd"> | |
<!-- | |
Kate SCSS syntax highlighting definition | |
Modified the Kate CSS syntax highlighting definition to support SCSS. | |
This file should be merged with any updates to the normal Kate CCS definition (see note on version numbering in changelog for 1.2.03.0). | |
The latest version of this file can be found at https://gist.github.com/958598 |
This file contains 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
#!/bin/bash | |
branch=$(git name-rev --name-only HEAD) | |
git rebase --onto HEAD~2 HEAD~1 HEAD | |
git cherry-pick ORIG_HEAD~1 | |
git update-ref refs/heads/$branch $(git rev-parse HEAD) | |
git checkout --quiet $branch | |
# Instead of creating an independant bash script with the code above, | |
# consider simply creating a git alias using the command below. |
This file contains 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
/** | |
* An implementation for Quicksort. Doesn't | |
* perform as well as the native Array.sort | |
* and also runs the risk of a stack overflow | |
* | |
* Tests with: | |
* | |
* var array = []; | |
* for(var i = 0; i < 20; i++) { | |
* array.push(Math.round(Math.random() * 100)); |
This file contains 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
// Copyright 2011, Tom Switzer | |
// Under terms of ISC License: http://www.isc.org/software/license | |
/** | |
* Sorts an array of integers in linear time using bucket sort. | |
* This gives a good speed up vs. built-in sort in new JS engines | |
* (eg. V8). If a key function is given, then the result of | |
* key(a[i]) is used as the integer value to sort on instead a[i]. | |
* | |
* @param a A JavaScript array. |
This file contains 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
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* | |
* Modified by Nenad Damnjanović | |
* Nov 9, 2014 |
This file contains 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
'use strict'; | |
var xoauth2 = require('xoauth2'); | |
var nodemailer = require('nodemailer'); | |
var smtp = require('nodemailer-smtp-transport'); | |
var htmlToText = require('nodemailer-html-to-text').htmlToText; | |
// Sending mail with Gmail using XOAuth2 | |
// http://masashi-k.blogspot.com.br/2013/06/sending-mail-with-gmail-using-xoauth2.html |
This file contains 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
/* This is a technique to lazy load your javascript files | |
* Handy for those pesky slow, load blocking off-site scripts | |
* function lazyLoad | |
* @s: String of path to file | |
*/ | |
function lazyLoad(s) { | |
var d = window.document, | |
b = d.body, /* appends at end of body, but you could use other methods to put where you want */ | |
e = d.createElement("script"); |
This file contains 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
mymodule { | |
@at-root { | |
.#{&}-header { ... } | |
.#{&}-footer { ... } | |
.#{&}-body { | |
a { ... } | |
span { ... } | |
p { ... } | |
} | |
} |