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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ZeroBugBounce.ReddShift | |
{ | |
public class RedditUrlBuilder | |
{ | |
// http://www.reddit.com/top/?sort=top&t=week |
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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication7 | |
{ | |
public static class Program | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ReadLargeFileAsync | |
{ |
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
#!/usr/bin/env python | |
import re | |
import subprocess | |
import sys | |
f = open( sys.argv[1], "r" ) | |
commit_msg = f.read(); | |
f.close() | |
current_branches = subprocess.check_output(["git", "branch", "--no-color"]) |
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
// just enter this on the console to record both for 3 seconds | |
(function() { | |
console.timeline(); | |
console.profile(); | |
setTimeout(function() { | |
console.timelineEnd(); | |
console.profileEnd(); | |
}, 3000); | |
})(); |
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
var InlineWorker = | |
(function() { | |
var handleMessage = function(msg) { | |
if(this.onmessage) { | |
this.onmessage(msg); | |
} | |
} | |
InlineWorker = function(workerFunc) { | |
var code = workerFunc.toString(); |
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 shows forwarding jQuery events to native events | |
// where the target is hard-coded | |
forwardEventTo: function(e) { | |
var iframeDocument = this.$el.find('iframe')[0].contentWindow.document; | |
var target = iframeDocument.elementFromPoint(e.offsetX, e.offsetY); | |
if (target) { | |
var props = _.extend(e.originalEvent, { | |
srcElement: target, |
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
function getImageDimensions(path,callback) { | |
var img = new Image(); | |
img.onload = function () { | |
callback({ | |
width: img.width, | |
height: img.height | |
}); | |
}; | |
img.src = path; | |
} |
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
storage = { }; setInterval(function() { | |
if(storage.activeElement !== document.activeElement) { | |
storage.activeElement = document.activeElement; | |
console.log('new active element: %o', document.activeElement); | |
} | |
}, 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
// requires underscore.js or lodash.js | |
function findCssPropForSelector(className, prop) { | |
var rule; | |
_.each(document.styleSheets, function(ss) { | |
_.each(ss.cssRules, function(r) { | |
if(r.cssText.indexOf(className) >= 0) { | |
console.log('%s: %s', ss.href, r.style[prop]); | |
} | |
}); |
OlderNewer