Skip to content

Instantly share code, notes, and snippets.

View kstevens715's full-sized avatar

Kyle Stevens kstevens715

View GitHub Profile
@benjaminoakes
benjaminoakes / git-run-ci
Last active March 31, 2017 16:43
Push to a run-ci (whitelisted) branch to run CI on Travis, etc.
#!/bin/sh
show_usage() {
cat <<EOF
Usage: $0 branch_name
Push to a run-ci (whitelisted) branch to run CI on Travis, etc.
NOTE: this is only necessary for a project like WebAdMIT that has disabled CI
for branches by default. We explicitly whitelisted \`run-ci/*\`.
@zzak
zzak / commits-by-size.rb
Last active December 17, 2015 11:29
Commits by size
require 'git'
num_commits = 20000
sizes = {:s => 0, :m => 0, :l => 0, :xl => 0, :xxl => 0}
Git.open('.').log(num_commits).author('zzak').each do |commit|
log = `git show --numstat #{commit.sha}`
stat = 0
log.scan(/^(\d+)\t(\d+)/).flatten.each { |i| stat += i.to_i }
@kstevens715
kstevens715 / mfcj835dw.sh
Created April 28, 2013 01:31
Script to install an MFC-J835DW printer on a 64-bit instal of Ubuntu 13.04. Should be compatible with earlier versions as well.
#!/usr/bin/env bash
# Step 5b. (for Network Connection) Configure your printer on the cups web interface
# 5b-1. Open a web browser and go to "http://localhost:631/printers".
# 5b-2. Click "Modify Printer" and set following parameters.
#
# - "LPD/LPR Host or Printer" or "AppSocket/HP JetDirect" for Device
# - lpd://192.168.1.8/binary_p1 for Device URI
# - Brother for Make/Manufacturer Selection
# - Your printer's name for Model/Driver Selection
@tomdale
tomdale / gist:3981133
Last active November 26, 2019 21:19
Ember.js Router API v2

WARNING

This gist is outdated! For the most up-to-date information, please see http://emberjs.com/guides/routing/!

It All Starts With Templates

An Ember application starts with its main template. Put your header, footer, and any other decorative content in application.handlebars.

<header>
@joewest
joewest / didRequestRange.js
Created January 13, 2012 20:14
Ember.PaginationSupport
App.collectionController = Em.ArrayProxy.create(Ember.PaginationSupport, {
content: [],
fullContent: App.store.findAll(App.Job),
totalBinding: 'fullContent.length',
didRequestRange: function(rangeStart, rangeStop) {
var content = this.get('fullContent').slice(rangeStart, rangeStop);
this.replace(0, this.get('length'), content);
}
});