Skip to content

Instantly share code, notes, and snippets.

@timemachine3030
timemachine3030 / forever-setup.bash
Last active August 29, 2015 14:07
Nodejs init.d script
#!/bin/bash -e
SERVICE=node_server
INIT_LOCATION=/etc/init.d/${SERVICE}
npm install -g forever
mkdir /var/run/forever
touch $INIT_LOCATION
@timemachine3030
timemachine3030 / clone.bash
Last active August 29, 2015 14:05
Update a rackspace nodejs delopyment
#!/bin/bash -e
cd /var/apps
GIT=`which git`
REPO=$1
echo repo: $REPO
## Get the hash othe origin/master
@timemachine3030
timemachine3030 / Gruntfile.js
Created October 20, 2013 21:37
Bootstrap 2.3.2 with grunt-usemin
compass: {
options: {
importPath: '<%= yeoman.app %>/bower_components',
}
},
copy {
dist: {
files: [{
src: [
@timemachine3030
timemachine3030 / gist:6346245
Created August 26, 2013 20:27
Angular Analytics Service
var analytics = angular.module('analytics', ['ng']);
analytics.service('analytics', ['$rootScope', '$window', '$location', function ($rootScope, $window) {
$rootScope.$on('$viewContentLoaded', function () {
//$window.ga.push(['_trackPageView', $location.path()]);
$window.ga('send', 'pageview');
});
}]);
@timemachine3030
timemachine3030 / gist:1034685
Created June 19, 2011 20:13
Max apache log information
# Log each type to a different file
# - Add to your .htaccess file
# - Remember to remove from production servers when done as it can be verbose.
ErrorLog /path/to/apache/writable/dir/of/logs/error.log
Loglevel debug
CustomLog /path/to/apache/writable/dir/of/logs/access.log combined
<IfModule mod_rewrite.c>
@timemachine3030
timemachine3030 / Chaining
Created December 3, 2010 08:08
This is how you chain
var MyClass = function () {};
MyClass.prototype.one = function () {
console.log(1);
return this;
}
MyClass.prototype.two = function () {
console.log(2);
return this;
}