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

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
StevenBlack / pr.md
Created Nov 7, 2015 — forked from piscisaureus/pr.md
Checkout github pull requests locally
View pr.md

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 = git@github.com:joyent/node.git

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
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
else
@hook.sethook( arg )
end
View resetDropbox.sh
#!/bin/sh
# Source: https://www.dropbox.com/en/help/72
# 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
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
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
*==========================
FUNCTION Init()
*==========================
SET CENTURY TO 20 ROLLOVER 50
SET CENTURY ON
View keybase.md

Keybase proof

I hereby claim:

  • I am StevenBlack on github.
  • I am stevenblack (https://keybase.io/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
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 + "google-analytics.com/ga.js", function(){
// tell Analytics about the current page load using standard _trackPageview method
try {
var pageTracker = _gat._getTracker( $.mcm.apiKeys.analytics );
// the standard page tracking code
pageTracker._trackPageview();
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
View web-servers.md

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.