Skip to content

Instantly share code, notes, and snippets.

View jhaynie's full-sized avatar

Jeff Haynie jhaynie

View GitHub Profile
/*****
To authorize on Twitter API through xAuth, you need HMAC-SHA1
I'm using the following lib for that:
http://jssha.sourceforge.net
Make sure you have sha.js included!
<script src="http://jssha.sourceforge.net/sha.js"></script>
Also, you need to email api@twitter.com to get xAuth access
I cannot do that for you - see http://dev.twitter.com/pages/xauth
@jhaynie
jhaynie / app.js
Created June 19, 2013 18:35 — forked from viezel/app.js
// This is an example of use.
// Here we use the new Bearer Token thats make it possible to get tweets without user login
// More info on Bearer here: https://dev.twitter.com/docs/auth/application-only-auth
// Full Codebird API is here: https://github.com/mynetx/codebird-js
var Codebird = require("codebird");
var cb = new Codebird();
cb.setConsumerKey('CONSUMER_KEY', 'CONSUMER_SECRET_KEY');
var bearerToken = Ti.App.Properties.getString('TwitterBearerToken', null);
function getKeys(obj, keys) {
keys = keys || {};
Object.keys(obj).forEach(function(k){
if (!k in keys) {
var o = obj[k];
keys[k] = 1;
if (typeof o === 'Object') {
getKeys(o,keys);
}
}
auto _Folder = Windows::Storage::ApplicationData::Current->LocalFolder;
auto _Option = Windows::Storage::CreationCollisionOption::ReplaceExisting;
// create file async
_Folder->CreateFileAsync("MyFileName", _Option);
// create file sync by wrapping in task - then pattern
IAsyncOperation<StorageFile^>^ fileOp = _Folder->CreateFileAsync("MyFileName2", _Option);
auto deviceEnumTask = create_task(fileOp);
deviceEnumTask.then([](StorageFile^ myFile)
@jhaynie
jhaynie / 0_reuse_code.js
Created May 13, 2014 09:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/**
* Helper Functions for Handlebars Templating engine
*/
var fs = require('fs'),
path = require('path'),
Arrow = require('arrow');
/**
@jhaynie
jhaynie / airflow_config.go
Created March 25, 2017 06:15 — forked from kozikow/airflow_config.go
Airflow config
// Generate airflow config to stdout.
// To start service the from scratch, put this in src/airflow_config/airflow_config.go and run:
// export GOPATH=$(pwd)
// export PATH=$PATH:$GOPATH/bin
// go get k8s.io/client-go/1.4/kubernetes
// go install airflow_config && airflow_config > airflow.yaml
// kubectl create -f airflow.yaml
package main
import (