Skip to content

Instantly share code, notes, and snippets.

View StevenBlack's full-sized avatar
🇨🇦

Steven Black StevenBlack

🇨🇦
View GitHub Profile
@StevenBlack
StevenBlack / sessionfactory.prg
Last active June 22, 2016 10:58
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.
*=======================================
DEFINE CLASS SessionFactory AS Session
*=======================================
DataSession = 2 && private
*==========================
FUNCTION Init()
*==========================
SET CENTURY TO 20 ROLLOVER 50
SET CENTURY ON

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 September 27, 2019 09:20
Google Analytics Events Example
// 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();
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
@StevenBlack
StevenBlack / git.rb
Created June 2, 2013 22:20 — forked from alx/git.rb
Jekyll plugin to add Git activity inside a list
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 02:11
Visual FoxPro stack lister
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 March 17, 2013 21:35
ygktraffic twitter filter
ygktraffic -rt -from:ygktraffic -deevideo -thank -thanks -follow -nailaj -keeliesmama
@StevenBlack
StevenBlack / gist:5096982
Last active December 14, 2015 13:58
#YGKC twitter filter
#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 February 3, 2013 16:14
Twitter search for Jekyll, the blog aware site generator
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