Skip to content

Instantly share code, notes, and snippets.

View frozeman's full-sized avatar

Fabian Vogelsteller frozeman

View GitHub Profile
@frozeman
frozeman / gist:b3f016de58b04c99cfc3
Created November 11, 2014 20:27
Steps in phantomjs
var page = new WebPage(), testindex = 0, loadInProgress = false;
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.onLoadStarted = function() {
loadInProgress = true;
console.log("load started");
};
@frozeman
frozeman / bitcoin-divisions
Last active August 29, 2015 14:08
Bitcoin divisions
0 . 0 0 0 0 0 0 0 0
^ ^ ^ ^
BTC mBTC? bits Satoshi
Verifying myself: My Bitcoin username is +frozeman. https://onename.io/frozeman
@frozeman
frozeman / CryptsyOrderSum
Last active August 29, 2015 14:04
Get the order sum in cryptsy.com
// in the console, to get the BUY/SELL order sum type:
var until = 9999; // until order
var sum = 0; $('#sellorderlist tr:lt('+until+')').each(function(){ sum += Number($(this).find('td:eq(2)').text())}); console.log('SEll: '+sum+' BTC by '+$('#sellorderlist tr').length+' orders');
var sum = 0; $('#buyorderlist tr:lt('+until+')').each(function(){ sum += Number($(this).find('td:eq(2)').text())}); console.log('BUY: '+sum+' BTC by '+$('#buyorderlist tr').length+' orders');
@frozeman
frozeman / gist:88a3e47679dd74242cab
Last active August 29, 2015 14:01
Meteor minimongo: Insert and Remove in bulk using an array
/*
These two functions provide a simple extra minimongo functionality to add and remove documents in bulk,
without unnecessary re-renders.
The process is simple. It will add the documents to the collections "_map" and only the last item will be inserted properly
to cause reactive dependencies to re-run.
*/
Models = {};
@frozeman
frozeman / gist:8206698
Last active January 1, 2016 21:58
jQuery testing stubs. Where the stub can be overwritten e.g. by setting jQueryStub.prototype.find = ...;
var $, jQueryStub;
(function () {
"use strict";
var emptyFunction = function () {
};
var selfReturn = function(){
return new jQueryStub();
};
DB = {};
DB.movies = new Meteor.Collection('movies');
DB.ratings = new Meteor.Collection('ratings');
/*
* OfflineCollections, works as wrapper to easily clean your local collections
*/
OfflineCollections = (function(){
// PRIVATE