Skip to content

Instantly share code, notes, and snippets.

View tanepiper's full-sized avatar

Tane Piper tanepiper

View GitHub Profile
@tanepiper
tanepiper / issue.js
Last active September 9, 2015 23:51
A Google Apps script to push
// I can't figure out how to add custom text to the `payload` variable above.
// I've tried:
var accessRequest = "The following user wants to join WADE:" + contactHow
var payload = {
channel: "#botspam",
username: "recruitbot",
text: accessRequest,
icon_emoji: ":raised_hands::skin-tone-4:"
};
var options = {

Debugging & Profiling Node.js

This is a maintained listing of all the different ways to debug and profile Node.js applications. If there is something missing or an improvement, post a comment! :)

Interactive Stack Traces with traceGL - Shareware

  1. Guide here
// vendor
var express = require('express');
var app = express();
// depending on the placement, we can either catch or override routes
app.use(app.router);
// every route in the routes/user.js file will be served under /user
app.use('/user', require('./routes/user').middleware);
define([
'vent',
'routers/manage/groups',
'routers/manage/learners',
'controllers/manage/groups',
'controllers/manage/learners',
'views/layouts/manage/module',
'views/tab/collection',
'collections/client/tab'
], function (
Following the news about Facebook buying Instagram I decided to delete my Instagram account before Facebook claims ownership of my pictures.
Since the Instagram-recommended (in their FAQ): http://instaport.me/export doesn't work for me (probably they can't cope with the high demand),
here is a quick and dirty way to download all my Instagram pictures in their highest resolution in a few easy steps.
You will need: Firefox, Firebug, some text editor, wget
1. Go to http://statigr.am/yourlogin using Firefox with Firebug extension active
2. Scroll down as many times as it is needed to have all yor pictures thumbnails displayed (I had some 3 hundred pictures so it was not that much scrolling, YMMV)
3. In the Firebug JS console run this JS code: $(".lienPhotoGrid a img").each(function(index) { console.log($(this).attr('src')) })
4. JS console will contain urls to all the thumbnails images, like this: http://distilleryimage1.s3.amazonaws.com/4ed46cf2801511e1b9f1123138140926_5.jpg
@tanepiper
tanepiper / interval.js
Created December 4, 2012 11:32 — forked from manast/interval.js
Accurate Javascript setInterval replacement
function interval(duration, fn){
this.baseline = undefined
this.run = function(){
if(this.baseline === undefined){
this.baseline = new Date().getTime()
}
fn()
var end = new Date().getTime()
this.baseline += duration
/*
* Javascript EXIF Reader 0.1.4
* Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com, http://blog.nihilogic.dk/
* Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt]
*/
var EXIF = {};
(function() {
@tanepiper
tanepiper / gist:3655791
Created September 6, 2012 12:33 — forked from twhid/gist:2648062
grunt task to deploy JS files to S3 with awssum
grunt.registerMultiTask('s3deploy', 'deploy to S3 using awssum', function () {
// dependencies
var awssum = require('awssum'),
fs = require('fs'),
path = require('path'),
aws = require('./settings').aws;
var amz = awssum.load('amazon/amazon'),
AmazonS3 = awssum.load('amazon/s3'),
s3 = new AmazonS3(aws.accessKey, aws.secretKey, aws.accountId , amz.US_EAST_1),
@tanepiper
tanepiper / README.md
Created June 19, 2012 12:21 — forked from mbbx6spp/README.md
Retaining Git history of subdirectory from parent repository

Subdirectory Git Repository

This is a mini howto on moving a subdirectory to its own repository retaining history

Howto

Assume PARENT is the original parent Git repository (locally) and CHILD is the new local repository that you wish to create from a subdirectory, retaining all of its history from the PARENT repository; PARENT_PATH and CHILD_PATH are the paths to PARENT and CHILD respectively; SUBDIR is the relative path within the repository under extraction:

  1. git clone --no-hardlinks PARENT_PATH CHILD_PATH
  2. pushd CHILD_PATH
@tanepiper
tanepiper / process.nextTick.js
Created June 19, 2012 10:59 — forked from WebReflection/process.nextTick.js
process.nextTick(callback) for browsers too
!function (window) {"use strict";
// by WebReflection - WTFPL License
var
prefixes = "r webkitR mozR msR oR".split(" "),
process = "process",
nextTick = "nextTick",
i = 0,
p = window[process] || (window[process] = {})
;
while (!p[nextTick] && i < prefixes.length)