This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for k in 0..99 | |
c = Course.new | |
c.term = "Spring" | |
c.year = 2012 | |
c.title = "EECS 1" + sprintf("%02d", k) | |
c.description = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." | |
c.save | |
cm = CourseMembership.new | |
cm.user = User.first | |
cm.course = c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
class ImageUploader < CarrierWave::Uploader::Base | |
attr_reader :file | |
include CarrierWave::RMagick | |
include Magick | |
storage :file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# ... or force ignoredups and ignorespace | |
HISTCONTROL=ignoredups:ignorespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import grequests | |
from collections import deque | |
class RequestQueue(object): | |
""" | |
This is a lame imitation of a Typhoeus Hydra using GRequests. | |
The main thing this allows is building up a queue of requests and then | |
executing them, and potentially adding requests to the queue in a callback | |
so that you can build requests that depend on other requests more naturally. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
170.365193] c0 [E-PEN] wacom_i2c_coord failed to read i2c.L521 | |
<7>[ 170.386588] c3 [E-PEN] pdct 0(0) | |
<7>[ 170.386613] c3 [E-PEN] forced_hover | |
<6>[ 170.575035] c0 pet_watchdog_timer_fn kicking...c033 | |
<6>[ 170.770177] c0 [E-PEN]: wacom_i2c_query: 0th ret of wacom query=-6 | |
<6>[ 170.770265] c0 [E-PEN]: wacom_i2c_query: 1th ret of wacom query=-6 | |
<6>[ 170.770350] c0 [E-PEN]: wacom_i2c_query: 2th ret of wacom query=-6 | |
<6>[ 170.770430] c0 [E-PEN]: wacom_i2c_query: 3th ret of wacom query=-6 | |
<6>[ 170.770513] c0 [E-PEN]: wacom_i2c_query: 4th ret of wacom query=-6 | |
<6>[ 170.770597] c0 [E-PEN]: wacom_i2c_query: 5th ret of wacom query=-6 |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------- beginning of /dev/log/main | |
V/AudioPolicyManagerBase( 4753): getDeviceForStrategy() strategy 2, device 2 | |
V/AudioPolicyManagerBase( 4753): getDeviceForStrategy() strategy 0, device 2 | |
V/AudioPolicyManagerBase( 4753): getDeviceForStrategy() strategy 3, device 2 | |
V/AudioPolicyManagerBase( 4753): getDeviceForStrategy() strategy 4, device 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function make(){ | |
/usr/bin/make "$@" | |
EXITCODE=$? | |
QUIET=false | |
OPTIND=1 | |
while getopts ":q" opt; do | |
case $opt in | |
q) | |
QUIET=true | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
git diff --cached --word-diff=porcelain -b --no-prefix | grep "^[\+\-][^\+\-]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Go to http://jsfiddle.net/zdJ9f/1/embedded/result/ to get a link to this bookmarklet, or stick the following HTML someplace, or make a just bookmark to the href of the link below. | |
<a href="javascript:(function(){document.body.appendChild(document.createElement('script')).src='https://raw.github.com/gist/4167712/test.js';})();">Github Inline Diffs</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun goto-student-feedback () | |
(interactive) | |
(string-match | |
(rx (group "hw" digit) (any ascii) (group "cs30f" (1+ alpha))) | |
(buffer-file-name)) | |
(let* ( | |
(hwnum (match-string 1 (buffer-file-name))) | |
(username (match-string 2 (buffer-file-name))) | |
(feedback-path (concat "/home/linux/ieng6/cs30f/public/" hwnum "_feedback/style_feedback_" username)) |