Skip to content

Instantly share code, notes, and snippets.

Justin Hileman bobthecow

Block or report user

Report or block bobthecow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dblock / api_logger.rb
Created Dec 10, 2012
API logger with Grape under Rails
View api_logger.rb
class ApiLogger < Grape::Middleware::Base
def before "[api] Requested: #{request_log_data.to_json}\n" +
"[api] #{response_log_data[:description]} #{response_log_data[:source_file]}:#{response_log_data[:source_line]}"
def request_log_data
justinperkins / jquery-auth-token.js
Created Oct 26, 2012
Put auth-token on all jQuery Ajax Requests
View jquery-auth-token.js
var tokenValue = $("meta[name='csrf-token']").attr('content');
headers: {'X-CSRF-Token': tokenValue}
ttscoff / searchlink.rb
Last active Jan 26, 2020
SearchLink creates Markdown links from automatic searches based on special syntax.
View searchlink.rb
View gist:3855290
<?xml version="1.0"?>
<name>Truly Ergonomic Keyboard</name>
DIP switch settings:
1 2 3 4 5
ttscoff / grablinks.js
Created Sep 30, 2012
Bookmarklet to send all links within clicked div/table to Pinboard
View grablinks.js
View AgaviMustacheRenderer.class.php
// +---------------------------------------------------------------------------+
// | This file is part of the Agavi package. |
// | Copyright (c) 2012 Parspooyesh co. |
// | |
// | For the full copyright and license information, please view the LICENSE |
// | file that was distributed with this source code. You can also view the |
// | LICENSE file online at |
// | vi: set noexpandtab: |
ttscoff / planter.rb
Created Sep 22, 2012
Create directory trees from indented text input
View planter.rb
Planter v1.3
Brett Terpstra 2013
ruby script to create a directory structure from indented data.
Three ways to use it:
- Pipe indented (tabs or 2 spaces) text to the script
- e.g. `cat "mytemplate" | planter.rb
- Create template.tpl files in ~/.planter and call them by their base name
sjl /
Created Sep 19, 2012


Brainstorming a friendlier find(1).



ttscoff / flavor.rb
Created Sep 16, 2012
Quick wrapper to convert Markdown to HTML via Github API
View flavor.rb
# Convert a Markdown README to HTML with Github Flavored Markdown
# Github and Pygments styles are included in the output
# Requirements: json gem (`gem install json`)
# Input: STDIN or filename
# Output: STDOUT
# Arguments: "-c" to copy to clipboard (or "| pbcopy"), or "> filename.html" to output to a file
# cat | flavor > README.html
KuraFire / rgbaa.scss
Created Sep 13, 2012
More dynamic, oldIE-compatible SCSS function for rgba
View rgbaa.scss
@function rgbaa($args...) {
// rgbaa(#FFF, .5)
@if length($args) == 2 {
$hex: nth($args, 1);
$alpha: nth($args, 2);
@if $oldIE == 1 {
@return rgb(red($hex), green($hex), blue($hex));
} @else {
@return rgba(red($hex), green($hex), blue($hex), $alpha);
You can’t perform that action at this time.