Skip to content

Instantly share code, notes, and snippets.

Simon Hill metalaureate

Block or report user

Report or block metalaureate

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:edafc6e91d677fb13016c1b7319446f6
2016-11-13 08:33:12.083222 Hisgeogram[7447:1674757] [Accessibility] ****************** Loading GAX Client Bundle ****************
2016-11-13 08:33:12.145147 Hisgeogram[7447:1674757] Apache Cordova native platform version 4.1.1 is starting.
2016-11-13 08:33:12.145621 Hisgeogram[7447:1674757] Multi-tasking -> Device: YES, App: YES
2016-11-13 08:33:12.182653 Hisgeogram[7447:1674757] Using UIWebView
2016-11-13 08:33:12.183502 Hisgeogram[7447:1674757] [CDVTimer][handleopenurl] 0.043988ms
2016-11-13 08:33:12.184258 Hisgeogram[7447:1674757] [CDVTimer][intentandnavigationfilter] 0.708044ms
2016-11-13 08:33:12.184326 Hisgeogram[7447:1674757] [CDVTimer][gesturehandler] 0.029981ms
2016-11-13 08:33:12.223696 Hisgeogram[7447:1674757] [CDVTimer][photolibrary] 39.330006ms
2016-11-13 08:33:12.244399 Hisgeogram[7447:1674757] [CDVTimer][splashscreen] 20.635962ms
2016-11-13 08:33:12.245151 Hisgeogram[7447:1674757] [CDVTimer][keyboard] 0.671983ms
View gist:252cd6fc7ffea1027d5f3acc08c7ca20
function fixOrientation(url, cb) {
// this function takes an s3 image
// check if it needs to be rotated
// if so, it creates a new version rotated
// uploads to S3
// and passes the url back
var exif = require('exif').ExifImage;
var easyimg = require('easyimage');
var path = require('path'), fs = require('fs-extra'), request = require('request');
View config.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="co.ifwe.heartbeat.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Heartbeat</name>
<description>
A minimal way to stay connected and feel loved.
</description>
<author email="simon@ifwe.co" href="http://ionicframework.com/">
if(we)
</author>
<content src="index.html"/>
View Trigger Flash Message
var id = Flash.create('success', '<strong>Well done!</strong> You successfully read this important alert message.', 5000, {
class: 'custom-class',
id: 'custom-id'
}, true);
View recurse_path
var d3tree = Convert(tree, 0, []);
var lineage = [];
function Convert(obj_to_convert, level, lineage) {
var new_obj = [];
delete obj_to_convert['null'];
console.log('level', level);
level++;
@metalaureate
metalaureate / protractor mail-tester.js
Created Apr 29, 2015
var flow = protractor.promise.controlFlow(); console.log('starting test for email'); flow.execute(function () { return mail.waitForMail(protractor.promise.defer(), { username: '[email account login]', password: '[email account password]' }, "Validate",test_account.username, 60000) .then(function resolve(body) { console.log('email', body.text); v…
View protractor mail-tester.js
// Module dependencies.
var async = require('async');
var _ = require('underscore');
var application_root = __dirname,
path = require('path'); //Utilities for dealing with file paths
var request = require('request');
var Q = require('q');
var POP3Client = require("poplib");
var MailParser = require("mailparser").MailParser;
View debug_test.js
function mutualSubscribe(source, friend, callback) {
var XMPP = require('stanza.io');
var friend_jid = friend.toLowerCase() + '@xxxx.me';
var source_jid = source.toLowerCase() + '@xxxx.me';
var source_client = XMPP.createClient({
jid: source_jid,
password: 'xyz',
transport: 'bosh',
boshURL: config.get('xmpp.bosh_url')
View debug_test.js
function mutualSubscribe(source, friend, callback) {
var XMPP = require('stanza.io');
var friend_jid = friend.toLowerCase() + '@idelog.me';
var source_jid = source.toLowerCase() + '@idelog.me';
var source_client = XMPP.createClient({
jid: source_jid,
password: source.split("").reverse().join(""),
transport: 'bosh',
View debug_test.js
function mutualSubscribe(source, friend, callback) {
var XMPP = require('stanza.io');
var friend_jid = friend.toLowerCase() + '@idelog.me';
var source_jid = source.toLowerCase() + '@idelog.me';
var source_client = XMPP.createClient({
jid: source_jid,
password: source.split("").reverse().join(""),
transport: 'bosh',
boshURL: config.get('xmpp.bosh_url')
View debug_test.js
function mutualSubscribe(source, friend, callback) {
var XMPP = require('stanza.io');
var friend_jid = new XMPP.JID(friend.toLowerCase() + '@idelog.me');
var source_jid = new XMPP.JID(source.toLowerCase() + '@idelog.me');
var source_client = XMPP.createClient({
jid: source_jid,
password: source.split("").reverse().join(""),
transport: 'bosh',
boshURL: config.get('xmpp.bosh_url')
You can’t perform that action at this time.