Skip to content

Instantly share code, notes, and snippets.


Ross Harrison rharriso

View GitHub Profile
rharriso /
Last active Aug 29, 2015
Adding lib headers to YouCompleteMe
# ...other config .....
# include all headers
for root, dirs, files in os.walk("./"):
if any("*.h" or "*.hpp" in files):
rharriso / cengage_convert.rb
Created Aug 10, 2015
methods for converting to cengage filenames
View cengage_convert.rb
require 'fileutils'
require 'securerandom'
# all files must match cengage file names
def cengagify_files folder_path
Dir.glob("#{folder_path}/**/*").each do |f|
# skip directories and simple names
next if
rharriso / Concept.js
Created Jun 6, 2012
Backbone.js: Handle multiple binds to the same model, with different contexts.
View Concept.js
Backbone event binding works very well. It is possible to remove listeners from specific context without specifying a named function
//set up model
var Ork = Backbone.Model.extend({
defaults:{ says: "Waaaaaagh" }
var o = new Ork();
rharriso / MobileArtillery.m
Created Aug 24, 2012
kinda looks like NOD Mobile Artillery
View MobileArtillery.m
[[[[UIAlertView alloc] initWithTitle:@"Alert Title"
otherButtonTitles:nil, nil] autorelease] show];
rharriso / add_authors.rb
Created Sep 15, 2012
add authors to books, has and belongs to many bro
View add_authors.rb
def add_authors
#set authors to those in the form
unless params[:authors].blank?
@book.authors << Author.find(params[:authors])
rharriso /
Created Nov 5, 2015
Nautilus script to copy to clipboard on right click (using clipit)
#! /bin/bash
# model file
class SimpleModel extends Backbone.Model
# view file
class SimpleView extends Backbone.View
# click listener
onClick: ->
# spec file
rharriso / .zshrc
Created Jun 29, 2013
Custom prompt display for Zsh. Shows current user, time, machine name, current directory, and current git branch (if applicable)
View .zshrc
# prompt
alias ls='ls -G'
# Stuff for git
parse_git_branch () {
git branch 2> /dev/null | grep "*" | sed -e 's/* \(.*\)/ (\1)/g'
rharriso / embed-robot.head.html
Created Mar 4, 2016
Embedding Font with many faces in Hype
View embed-robot.head.html
<!-- How to embed Roboto locally -->
<!-- see instructions here: -->
<!-- download files from Google (google it) -->
/* base face */
@font-face {
font-family: 'Roboto', Arial, Helvetica;
src: url('${resourcesFolderName}/Roboto-Regular.ttf') format('truetype');
View gulptask-nodemon-newlinereplace.js
server-start starts up nodemon
the output is corrected to show new lines correctly.
var nodemon = require('gulp-nodemon');
var replace = require('stream-replace');
var gutil = require('gulp-util');
// Start server with nodemon