Skip to content

Instantly share code, notes, and snippets.

Getting pucks deep

Steven Black StevenBlack

Getting pucks deep
Block or report user

Report or block StevenBlack

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
StevenBlack /
Last active Dec 7, 2015
Suggestion for Github's Issues UI.

I have a suggestion for the Github UI in Issues.

Currently in Issues: one types Issue #17 or just #17 and this resolves to a link of the Issue. This is great!

Cool suggestion: Use of the existing Issue mini icon so the link rendering looks like this, where the current state of the issue is displayed.

Bonus Points: Hovering on the Issue link displays the Issue title in a tooltip.

StevenBlack /
Created Nov 7, 2015 — forked from piscisaureus/
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

StevenBlack / hooks.rb
Last active Aug 29, 2015
Basic hooks and anchors in Ruby.
View hooks.rb
class AbstractHook
@oHook = nil
def sethook( *args )
args.each { |arg|
if @hook.nil?
@hook = arg
@hook.sethook( arg )
# Source:
# Terminate Dropbox, then...
sudo chflags -R nouchg ~/Dropbox ~/.dropbox ~/.dropbox-master
sudo chown "$USER" "$HOME"
sudo chown -R "$USER" ~/Dropbox ~/.dropbox ~/.dropbox-master
sudo chmod -RN ~/.dropbox ~/Dropbox ~/.dropbox-master
StevenBlack / gist:f5501b42dce78b047824
Last active Aug 29, 2015 — forked from Greyvy/gist:8872903
Arbitrary data passed to Jekyll partials
View gist:f5501b42dce78b047824
<!-- partial.html -->
<div class="Tile">
{% if include.title %}
<h1>{{ include.title }}</h1>
{% else %}
<h1>no content!</h1>
{% endif %}
</div><!-- .Tile -->
<!-- in any template, partial, layout or content file -->
StevenBlack / sessionfactory.prg
Last active Jun 22, 2016
SessionFactory creates objects that are wrapped in a private data session. Note that the factory can die but its private datasession lives until all its products are out of scope.
View sessionfactory.prg
DEFINE CLASS SessionFactory AS Session
DataSession = 2 && private

Keybase proof

I hereby claim:

  • I am StevenBlack on github.
  • I am stevenblack ( on keybase.
  • I have a public key whose fingerprint is 1C52 CB4A 3BD9 EC28 E1BC DF99 8BC4 854E C83F 6EC6

To claim this, I am signing this object:

StevenBlack / GA-Events.js
Last active Sep 27, 2019
Google Analytics Events Example
View GA-Events.js
// Upon document ready, have jQuery do the following
$( function(){
var gaJsHost = ( ( "https:" === document.location.protocol ) ? "https://ssl." : "http://www." );
// use jQuery to call the Google Analytics JavaScript
$.getScript( gaJsHost + "", function(){
// tell Analytics about the current page load using standard _trackPageview method
try {
var pageTracker = _gat._getTracker( $ );
// the standard page tracking code
View jsonball.rb
require 'json'
require 'net/http'
# JSON parser tag, creating map for use in jekyll markdown
# Alex.Heneveld @ Cloudsoft Corp (remove spaces and add the .com)
# Released under APL 2.0
# usage: {% jsonball varname from TYPE PARAM %}
# where TYPE is one of {data,var,file,page}, described below

Discussion on reddit.

Each of these commands will run an ad hoc http static file server in your current (or specified) directory. Use this power wisely.

Python 2.x

$ python -m SimpleHTTPServer 8000
You can’t perform that action at this time.