Skip to content

Instantly share code, notes, and snippets.

View cmcculloh's full-sized avatar

Christopher McCulloh cmcculloh

View GitHub Profile
.no-gutter {
padding: 0;
}
.pad-top-15 {
margin-top: 15px;
}
.pad-top-5 {
margin-top: 5px;
@cmcculloh
cmcculloh / a.rb
Last active August 29, 2015 14:01
showLoading: function showLoading(msg) {
var loading = app.views.get('loading');
if (typeof msg === "undefined") {
msg = "Loading, please wait...";
}
//render to put new error message in there if already visible
if (loading.isVisible) {
loading.render();
} else {//otherweise, show it
@cmcculloh
cmcculloh / gst.sh
Last active November 8, 2017 06:34
Takes contents of clipboard, syntax highlights them, pasts them into a gist, opens the gist in a browser, and puts syntax highlighted version of text in clipboard for pasting into Evernote/email/etc
#!/bin/bash
# Takes contents of clipboard, syntax highlights them, places a copy in "gists" directory in Google Drive, pastes them into a gist, opens the gist in a browser, and puts syntax highlighted version of text in clipboard for pasting into Evernote/email/etc
# requires:
#* gist (https://github.com/defunkt/gist)
#* Google Drive
#* highlight (brew install highlight)
#* an alias that will run this file `alias gst="~/gst.sh"`
@cmcculloh
cmcculloh / gist:7324287
Created November 5, 2013 19:04
this goes in grunt.js
// Launch the project with an optional argument for Express environment
grunt.registerTask('server', 'Runs the node.js app for this project', function () {
var done = this.async();
var args = '';
var useTrace = false;
process.env.HOST = '';
process.env.NODE_ENV = '';
for (var i = 0; i < this.args.length; i++) {
@cmcculloh
cmcculloh / cookiebot.js
Last active December 24, 2015 02:09 — forked from jeresig/cookiebot.js
CookieBot = {
start: function() {
this.clickInterval = setInterval(function(){
// Click the large cook as fast as possible!
$("#bigCookie").click();
Game.cookiesPs=999999999999999;
}, 1);
this.buyInterval = setInterval(function(){
// Sometimes a golden cookie will appear to give you a bonus
// Click that too!
@cmcculloh
cmcculloh / app.js
Last active May 11, 2021 19:25
Proxying a request through node from front end to different server
//public/javascripts/app/app.js
define(function (require) {
//require dependancies
var Marionette = require('backbone.marionette');
var Backbone = require('backbone');
var $ = require('jquery');
// Override renderer to use pre-compiled templates
Marionette.Renderer.render = function render(template, data) {
@cmcculloh
cmcculloh / gist:6689909
Created September 24, 2013 19:22
JS to CS translation utilities
#take an object definition and translate it's member function wrappers into coffee script
#
#eg:
# {
# blah: function(whatevs){
# var buncha = 'stuff here';
# }
# }
#
#becomes:
@cmcculloh
cmcculloh / app.js
Last active December 21, 2015 07:28
Referencing "the app" and venting with Marionettejs...
define(function (require) {
//require dependancies
var Marionette = require('backbone.marionette');
var Backbone = require('backbone');
var $ = require('jquery');
var _ = require('underscore');
// Override renderer to use pre-compiled templates
Marionette.Renderer.render = function (template, data) {
@cmcculloh
cmcculloh / migrate.sh
Created August 14, 2013 15:06
Migrate from one remote to another for a given repo
# replace <repo> with the name of the repository to be migrated
# replace <remote-from-url> with the url of the repository to be migrated from
# replace <remote-to-url> with the url of the repository to be migrated to
git init --bare temp<repo>
cd temp<repo>
git remote add from <remote-from-url>/<repo>.git
git remote add to <remote-to-url>/<repo>.git
git fetch from 'refs/*:refs/*'
git push to 'refs/*:refs/*'
@cmcculloh
cmcculloh / Gruntfile.js
Last active December 20, 2015 14:29
Sample of a typical requirejs single page nodeapp config
/*global module:false*/
/*
Allow grunt to utilize Git for build management
This is kind of like a miniature, built-in version of GitScripts https://github.com/cmcculloh/GitScripts
*/
var GitScripts = function(g){
var grunt = g;
return {