Skip to content

Instantly share code, notes, and snippets.

@connyay
connyay / build
Created September 29, 2014 17:27
build example
#!/bin/bash
# Change home directory (bower puts a lot of cache and tmp directories here)
HOME=$OPENSHIFT_REPO_DIR
cd $OPENSHIFT_REPO_DIR
mkdir -p "$OPENSHIFT_DATA_DIR"node_modules
ln -s "$OPENSHIFT_DATA_DIR"node_modules node_modules
@connyay
connyay / index.js
Created September 19, 2014 21:48
zombie example
'use strict';
var Browser = require('zombie');
function logResult(num, period) {
console.log('There were ' + parseInt(num.replace(' ', ''), 10) + ' downloads in the last ' + period);
}
Browser.visit('https://www.npmjs.org/package/zombie', function(e, browser) {
var lastDay = browser.querySelector('.downloads tr:nth-of-type(1) td'),
lastWeek = browser.querySelector('.downloads tr:nth-of-type(2) td'),
@connyay
connyay / License
Last active August 29, 2015 14:06
openshift --from-code workaround
Copyright (c) 2014 Licensed under the MIT license.
'use strict';
var request = require('request');
var Q = require('q');
var fs = require('fs');
var config = require('./config');
var tokens = {};
if (!config) {
config = {};
@connyay
connyay / installed packages
Last active August 29, 2015 14:05
my sublime setup
{
"installed_packages":
[
"All Autocomplete",
"AngularJS",
"CSS Format",
"EditorConfig",
"Git",
"GitGutter",
"Grunt",
@connyay
connyay / build
Last active August 29, 2015 14:05
Building node app with grunt on open shift
HOME=$OPENSHIFT_REPO_DIR
cd $OPENSHIFT_REPO_DIR
if ! which nvm >/dev/null; then
curl https://raw.githubusercontent.com/creationix/nvm/v0.13.1/install.sh | bash
fi
source ~/.nvm/nvm.sh
nvm install v0.10