Skip to content

Instantly share code, notes, and snippets.

Avatar
🇨🇦

Steven Black StevenBlack

🇨🇦
View GitHub Profile
@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
@StevenBlack
StevenBlack / git.rb
Created Jun 2, 2013 — forked from alx/git.rb
Jekyll plugin to add Git activity inside a list
View git.rb
require 'git'
module Jekyll
class GitActivityTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
end
def render(context)
@StevenBlack
StevenBlack / vfpStackLister.prg
Created May 6, 2013
Visual FoxPro stack lister
View vfpStackLister.prg
LOCAL lnLvl, lcStack
lnLvl= PROGRAM( -1 )
lcStack = ""
FOR k= 1 TO lnLvl
lcStack = lcStack + PROGRAM( k )+ CHR( 13 )
ENDFOR
WAIT WINDOW lcStack
RETURN
@StevenBlack
StevenBlack / gist:5183757
Created Mar 17, 2013
ygktraffic twitter filter
View gist:5183757
ygktraffic -rt -from:ygktraffic -deevideo -thank -thanks -follow -nailaj -keeliesmama
@StevenBlack
StevenBlack / gist:5096982
Last active Dec 14, 2015
#YGKC twitter filter
View gist:5096982
#ygkc -rt -vieiraflytrap -wizfrenzy_03 -whiglive -989thedrive -983flyfm -instantfollowback -nailaj -ckws* -brenda_slomka -matt_bisson -robert_kiley -ottotrader -"Not tweeting or streaming" -InstantFollowBack -from:YGKRTs -nalaj
@StevenBlack
StevenBlack / gist:4702345
Created Feb 3, 2013
Twitter search for Jekyll, the blog aware site generator
View gist:4702345
lang:en filter:links jekyll -rt -hyde -hide -movie -NBC -island -jekyll_hydee -jekyll_andhyde -jekyll_.{1-} -*\_jekyll -_Dr__Jekyll_ -Jekyll.{1-} -henry_jekyll -lemonade_jekyll -W{1-}jekyll -watching -jekyll_hyde96 -jackie_jekyll
@StevenBlack
StevenBlack / Sites_Using_Jekyll.md
Last active Dec 11, 2015
Salvaged from the Jekyll repo as it seems maintainers there are apt to nix this.
View Sites_Using_Jekyll.md

Sites using Jekyll

It’s interesting to see what designs and features others have come up with. Link to Jekyll-powered blogs and other sites here.

@StevenBlack
StevenBlack / gist:4459239
Last active Dec 10, 2015
Bash script for the #YGK twitter hashtag. Uses the 't' command line client (a Ruby gem). This script uses Gist #4297661 to filter #ygk hashtag spam. https://gist.github.com/4297661
View gist:4459239
#!/bin/bash
# First install 't', the Twitter command line client: https://github.com/sferik/t#readme
# This is a Ruby gem and if you are on Mac OS X or any flavour of *nix you're probably got Ruby.
# Next ensure you have 'curl' installed (on Mac OS X you probably do)
# Given these two prerequisites then...
# Step 1: Grab the latest #ygk fluff filter from Gist #4297661 in raw form