Skip to content

Instantly share code, notes, and snippets.

View jimmyeisenhauer's full-sized avatar

Jimmy Eisenhauer jimmyeisenhauer

View GitHub Profile
@korczis
korczis / deferredRequest.js
Last active August 22, 2017 20:05
Deferred wrapper of cherio request
var deferred = require('deferred'),
request = require('request'),
cheerio = require('cheerio');
var deferredRequest = function(url) {
var d = deferred();
request(url, function (err, resp, body) {
if(err) {
d.reject(new Error("Unable to fetch '" + url + "', reason: " + err));
@hugs
hugs / center-ios-simulator.script
Created April 4, 2012 01:20
Center the iOS Simulator's window on your screen
-- Center the iOS Simulator's window on your screen
--
-- Copyright (C) 2012 Sauce Labs Inc
--
-- This work is licensed under the Creative Commons Attribution 3.0 Unported License.
-- To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/
-- or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
--
-- Usage:
-- $ osascript center-ios-simulator.script <scale>
@jcouyang
jcouyang / Stop_build_if_PR.sh
Last active June 15, 2020 02:03
make Bamboo support Github Pull Request with Status API
#!/bin/bash
if [[ -n ${bamboo_pull_num} ]]; then
echo 'stoping bamboo'
curl "http://${bamboo_BAMBOO_USER}:${bamboo_BAMBOO_password}@your.bamboo.domain/build/admin/stopPlan.action?${bamboo.planResultKey}-${bamboo.buildNumber}"
fi
@jordansissel
jordansissel / Procfile
Created April 5, 2012 19:29
Jenkins on Heroku
# Only listen on http; disable ajp and https
web: java -jar jenkins.war --httpPort=$PORT --ajp13Port=-1 --httpsPort=-1
@niallo
niallo / gist:3109252
Created July 14, 2012 04:54
Parse Github `Links` header in JavaScript
/*
* parse_link_header()
*
* Parse the Github Link HTTP header used for pageination
* http://developer.github.com/v3/#pagination
*/
function parse_link_header(header) {
if (header.length == 0) {
throw new Error("input must not be of zero length");
}