This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by jasonbyrne on 8/30/14. | |
*/ | |
window.JCB = window.JCB || {}; | |
JCB.Timing = (function(){ | |
// Self | |
var me = {}; | |
// Private Properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by jasonbyrne on 9/2/14. | |
*/ | |
var xYourHeart = (function(){ | |
// Self-reference | |
var xYourHeart = { | |
STATUS: { | |
PENDING: 0, | |
FAILURE: -1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var HTTP_STATUS = { | |
'OK': 200, | |
'CREATED': 201, | |
'ACCEPTED': 202, | |
'NON_AUTHORITATIVE': 203, | |
'NO_CONTENT': 204, | |
'RESET': 205, | |
'PARTIAL_CONTENT': 206, | |
'MULTI_STATUS': 207, | |
'ALREADY_REPORTED': 208, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var q = (function() { | |
var me = this, | |
_callbacks = [], | |
_index = -1, | |
_nonePending = true; | |
me.then = function(callback) { | |
// Add this to the queue | |
_callbacks.push(callback); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
install(){ | |
isApt=`command -v apt-get` | |
isYum=`command -v yum` | |
package=$1 | |
if [ -n "$isApt" ]; then | |
apt-get -y install $package | |
elif [ -n "$isYum" ]; then | |
yum -y install $package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Imperavi Redactor Plugin for Embedding Tweets | |
* for version >= 9.1 | |
* | |
* https://gist.github.com/jasonbyrne/6e96a907c781e90e0dbf | |
* | |
* @author Jason Byrne <jason.byrne@flocasts.com> | |
* @version 0.5.1 | |
* | |
* @forked https://gist.github.com/chekalskiy/7438084 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let request = require('request'); | |
let validUrl = require('valid-url'); | |
class PubSub { | |
protected subscribers: { [key: string]: Function } = {}; | |
public subscribe(callback: Function): string { | |
let key: string = Date.now() + '_' + Math.ceil(Math.random() * 10000); | |
this.subscribers[key] = callback; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Work in progress to convert this to TypeScript/Node: | |
// https://gist.github.com/biomancer/8d139177f520b9dd3495 | |
import { exec } from "child_process"; | |
/** | |
* | |
*/ | |
export class IframeByteRange { | |
public packetTime: number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Flagpole } = require('flagpole'); | |
const suite = Flagpole.Suite('iTunes API Test') | |
.base('https://itunes.apple.com'); | |
suite.Scenario('Music Videos Search') | |
.open('/search?term=2pac&entity=musicVideo') | |
.json() | |
.assertions(function (response) { | |
let firstResult = response.select('results').first(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { isFunction } from 'util'; | |
abstract class Listener { | |
protected listeners: { [eventName: string]: [Function] } = {}; | |
public on(eventName: string, callback: Function) { | |
this.listeners[eventName] = this.listeners[eventName] || []; | |
this.listeners[eventName].push(callback); | |
} |
OlderNewer