Skip to content

Instantly share code, notes, and snippets.

@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
@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",
'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 / License
Last active August 29, 2015 14:06
openshift --from-code workaround
Copyright (c) 2014 Licensed under the MIT license.
@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 / 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
'use strict';
var tracer = require('tracer');
var daily = tracer.dailyfile({
format: '{{message}}',
root: './logs'
});
var color = tracer.colorConsole({
format: '{{message}}'
});
var levels = ['log', 'trace', 'debug', 'info', 'warn', 'error'];
Name: node-diy
Cartridge-Short-Name: NODEDIY
Display-Name: Node DIY
Description: "Node.js cartridge that lets you take the wheel"
Version: '0.10.32'
Source-Url: https://github.com/connyay/openshift-node-diy.git
License: "Apache v2"
License-Url: https://github.com/connyay/openshift-node-diy/blob/master/LICENSE
Cartridge-Version: 0.1
Compatible-Versions: ['0.1']
@connyay
connyay / build
Last active August 29, 2015 14:10
PencilBlue config for OpenShift
#!/bin/bash
# .openshift/action_hooks/build
# Change home directory (npm puts a lot of cache and tmp directories here)
HOME=$OPENSHIFT_REPO_DIR
cd $OPENSHIFT_REPO_DIR
if [ "$OPENSHIFT_GEAR_UUID"=="$OPENSHIFT_APP_UUID" ]; then
# Main gear - cache node_modules for quicker pushes
mkdir -p "$OPENSHIFT_DATA_DIR"node_modules
@connyay
connyay / properties.json
Created March 10, 2015 12:01
sublime settings
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",