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
/** | |
* Wraps a function. It enables passing a new context and new arguments. | |
* @param func The actual function | |
* @param obj The context ('this' object) to pass to 'func'. If null is given, 'func' gets the context forwarded. | |
* @param args The arguments 'func' should receive. These will be added to the list of already passed arguments. | |
* @param addCtx Specifies whether the originally passed context should be added as an argument. | |
* @return A wrapper function. | |
* | |
* @author ComFreek | |
* @license Public Domain. Attribution optional. |
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
// requestAnim shim layer by Paul Irish | |
window.requestAnimFrame = (function(){ | |
return window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.oRequestAnimationFrame || | |
window.msRequestAnimationFrame || | |
function(/* function */ callback, /* DOMElement */ element) { | |
window.setTimeout(callback, 1000 / 60); | |
}; |
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
// Wikipedia article: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes | |
// jQuery Bookmarklet: http://marklets.com/jQuerify.aspx | |
// Extract language names | |
var str = ""; $("table td:nth-child(3)").each(function (idx, val) {str += $(val).text() + "\n";}); $("#bodyContent").prepend($("<textarea></textarea>").val(str)); | |
// Extract language codes (2 characters) | |
var str = ""; $("table td:nth-child(5)").each(function (idx, val) {str += $(val).text() + "\n";}); $("#bodyContent").prepend($("<textarea></textarea>").val(str)); |
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
// Wikipedia article: http://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements | |
// jQuery Bookmarklet: http://marklets.com/jQuerify.aspx | |
// Extract country codes | |
var str = ""; $("table td:nth-child(3)").each(function (idx, val) {str += $(val).text() + "\n";}); $("#bodyContent").prepend($("<textarea></textarea>").val(str)); |
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 LIVERELOAD_PORT = 35729; | |
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT}); | |
var mountFolder = function (connect, dir) { | |
return connect.static(require('path').resolve(dir)); | |
}; | |
// # Globbing | |
// for performance reasons we're only matching one level down: | |
// 'test/spec/{,*/}*.js' |
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
Bringing machine 'default' up with 'virtualbox' provider... | |
[default] Importing base box 'debian-wheezy72-x64-vbox43'... | |
[default] Matching MAC address for NAT networking... | |
[default] Setting the name of the VM... | |
[default] Clearing any previously set forwarded ports... | |
[default] Clearing any previously set network interfaces... | |
[default] Preparing network interfaces based on configuration... | |
[default] Forwarding ports... | |
[default] -- 22 => 2222 (adapter 1) |
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
// ==UserScript== | |
// @name StackOverflow List Button | |
// @description Additional list toolbar button for StackOverflow editor windows | |
// @version 1.0 | |
// | |
// @match *://stackoverflow.com/* | |
// @match *://meta.stackoverflow.com/* | |
// @match *://pt.stackoverflow.com/* | |
// | |
// @match *://serverfault.com/* |
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
/* | |
* Must be run on http://stackexchange.com/sites?view=list#traffic | |
* Your popup blocker must be deactivated. | |
*/ | |
var links = []; $(".lv-info a").each(function () { | |
links.push(this.href); | |
}); | |
var str = links.join("\n"); | |
window.open("data:text/plain;base64," + btoa(str), "Links"); |
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 compilation of code snippets required to render SVG files in JavaFX using Batik. | |
* See my full post on StackOverflow: http://stackoverflow.com/a/23894292/603003 | |
*/ | |
package proofofconcept; | |
import java.awt.image.BufferedImage; | |
import org.apache.batik.transcoder.TranscoderException; | |
import org.apache.batik.transcoder.TranscoderOutput; |
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
. |
OlderNewer