Skip to content

Instantly share code, notes, and snippets.

@siygle
siygle / gist:f766c835396bc05d02205f5c2e8cb2ef
Created February 2, 2017 02:49 — forked from keithics/gist:fd53431b6f57014249ca
Mongodump and Amazon Glacier
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
AWS = require('aws-sdk'),
exec = require('child_process').exec,
fs = require('fs'),
name = new Date().toISOString();
#!/usr/bin/env python
# Written with pymongo-2.6
# Modify for pymongo-2.1
#!/usr/bin/env python
__author__ = 'mongolab' \
var url = "https://www.facebook.com/dialog/oauth?&client_id=myBigClientID&redirect_uri=https://www.facebook.com/connect/login_success.html&response_type=token&scope=publish_actions";
function Response() {
this.access_token = null;
this.expires_in = null;
};
var response = new Response();
//function called every 500ms to check if token is in url
@siygle
siygle / gist:bed1aa3e7520fdbf2649
Last active August 29, 2015 14:07
JSDC.TW 2014
@siygle
siygle / gist:ae67a8dae900c2952c3c
Created July 20, 2014 18:31
intermediate swift
// Playground - noun: a place where people can play
import Cocoa
var str = "Hello, playground"
// optional type
// not sure which kind of data we will get
// default to nil
// Playground - noun: a place where people can play
import UIKit
// constant and variable
//let langName: String = "Swift"
//var version: Double = 1.0
//let introduced: Int = 2014
//let isAwesome: Boolean = true
@siygle
siygle / gist:f6cd45b3c4702c5d2500
Created July 4, 2014 04:09
phantom screenshot
var page = require('webpage').create();
var system = require('system');
var address, output, size;
if (system.args.length < 3 || system.args.length > 5) {
process.exit(1);
} else {
address = system.args[1];
output = system.args[2];
page.viewportSize = { width: 800, height: 500 };
//
// ViewController.swift
// TestSwift
//
// Created by Jameson Quave on 6/2/14.
// Copyright (c) 2014 JQ Software LLC. All rights reserved.
//
import UIKit
@siygle
siygle / gist:9678772
Created March 21, 2014 03:12
Parse Gmail Inbox to sheet
function processInboxToSheet() {
//var threads = GmailApp.getInboxThreads();
// Have to get data separate to avoid google app script limit!
var start = 0;
var threads = GmailApp.getInboxThreads(start, 100);
var sheet = SpreadsheetApp.getActiveSheet();
var result = [];
for (var i = 0; i < threads.length; i++) {
var messages = threads[i].getMessages();
@siygle
siygle / gist:9533495
Created March 13, 2014 18:01
spawnSync example
var sync = require('child_process').spawnSync;
console.log('start ls');
var ls = sync('ls', ['-lh', '/usr']);
console.log('end ls');
console.log('start grep');
var grep = sync('grep', ['local'], {
input: ls.stdout
})