Skip to content

Instantly share code, notes, and snippets.

View martindale's full-sized avatar
🚀
relentless maker.

Eric Martindale martindale

🚀
relentless maker.
View GitHub Profile
@martindale
martindale / links.txt
Last active August 29, 2015 14:24 — forked from maraoz/links.txt
@martindale
martindale / preprocessor_fun.h
Last active August 29, 2015 14:27 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@martindale
martindale / BlockPropagation.md
Last active September 21, 2015 17:52 — forked from gavinandresen/BlockPropagation.md
O(1) block propagation

O(1) Block Propagation

The problem

Bitcoin miners want their newly-found blocks to propagate across the network as quickly as possible, because every millisecond of delay increases the chances that another block, found at about the same time, wins the "block race."

@martindale
martindale / clone-all-twitter-github-repos.sh
Last active September 22, 2015 01:10 — forked from caniszczyk/clone-all-twitter-github-repos.sh
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
>++++++++++[<++++++++++>-]<[>+>[-]>++++++++++[<++++++++++>-]<+<<[->>->+<<<]>>>
[-<<<+>>>]<>>+++<<[->+>-[>+>>]>[+[-<+>]>+>>]<<<<<<]>[-<+>]+>[-]>[<<->>[-]]>[-]
<<<[[-]++++++++++[>++++++++++<-]>++.+++.[-]<[-]+++++++++++[>+++++++++++<-]>+..
[-]<[-]<<[-]>>]<>>+++++<<[->+>-[>+>>]>[+[-<+>]>+>>]<<<<<<]>[-<+>]+>[-]>[<<->>[
-]]>[-]<<<[[-]+++++++++[>+++++++++++<-]>-.[-]<[-]+++++++++[>+++++++++++++<-]>.
+++++..[-]<[-]<<[-]>>]<<[[-]>>++++++++++<[->-[>+>>]>[+[-<+>]>+>>]<<<<<]>[-]>>[
>++++++++[<++++++>-]<.[-]]<>++++++++[<++++++>-]<.[-]<<<]>[-]++++++++++.[-]<[-]
<-]
@martindale
martindale / gist:3895718
Created October 15, 2012 21:38 — forked from chrisinajar/gist:3889750
better chat window
// Make a bookmark with this in it:
javascript:(function(){$("#button-chat-expand").click(function() {$("#chat").animate({top:0})}); $("#button-chat-collapse").click(function() {$("#chat").animate({top:285})});$("#chat").css($("#playback").position()).width(842);$("#chat-messages").width(823); $.each(document.styleSheets, function(i, styleSheet) { $.each(styleSheet.cssRules, function(j, rule) { if (rule.selectorText == '.chat-message, .chat-mention, .chat-emote, .chat-skip, .chat-moderation, .chat-system, .chat-update' || rule.selectorText == '.chat-superuser' || rule.selectorText == '.chat-moderator') rule.style.width = '788px'; })});})();
@martindale
martindale / jarplug.js
Created October 16, 2012 00:26
jarplug phantomjs beginnings
var page = require('webpage').create();
// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this")
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.onLoadFinished = function(status){
if ('success' === status)
{
@martindale
martindale / plug.fm.js
Created October 16, 2012 00:54 — forked from pantlesswonder/plug.fm.js
plug.fm phantomjs
// Get twitter status for given account (or for the default one, "PhantomJS")
var page = require('webpage').create(),
twitterUsername = '',
twitterPassword = ''; //< default value
// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this")
page.onConsoleMessage = function(msg) {
console.log(msg);
};
@martindale
martindale / d.js
Created November 7, 2012 22:17
discotymeplaes
var e=!1,f=function(){var d=function(){var b=Math.floor(Math.random()*255),a=Math.floor(Math.random()*255),c=Math.floor(Math.random()*255);return"rgb("+b+","+a+","+c+")"},h=function(){jQuery("p, li, h1, h2, h3, div, span, a, input").each(function(b,a){if(jQuery(a).children().size()==0&&!jQuery(a).hasClass("partying")){var c=jQuery(a).text().split(" "),c=jQuery.map(jQuery.makeArray(c),function(a){return"<b style=\"color:"+d()+";display:inline ! important;font-size:auto ! important;font-weight:inherit ! important\" class=\"partying\">"+a+"</b>"});jQuery(a).html(c.join(" "))}});jQuery(".partying").each(function(b,a){jQuery(a).css("color",d())})},g=function(){setTimeout(function(){h();g();jQuery("body").css("background-color",d())},100)};g()};f();
var Site = angular.module('secret-project', []);
angular.element(document).ready(function() {
angular.bootstrap(document, [function($compileProvider, $locationProvider, $provide){
$locationProvider.html5Mode(true);
}]);
});
Site.config(function ($routeProvider) {
$routeProvider