Skip to content

Instantly share code, notes, and snippets.

View StevenBlack's full-sized avatar
🇨🇦

Steven Black StevenBlack

🇨🇦
View GitHub Profile

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 / gist:f5501b42dce78b047824
Last active August 29, 2015 14:17 — forked from Greyvy/gist:8872903
Arbitrary data passed to Jekyll partials
<!-- 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 / resetDropbox.sh
Created April 8, 2015 18:19
Dropbox Reset
#!/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 / hooks.rb
Last active August 29, 2015 14:19
Basic hooks and anchors in Ruby.
class AbstractHook
@oHook = nil
def sethook( *args )
args.each { |arg|
if @hook.nil?
@hook = arg
else
@hook.sethook( arg )
end
@StevenBlack
StevenBlack / filledIn.js
Created January 31, 2010 21:00
jqueyt.filledin.js
/**
jQuery custom selector that filters for input elements that have values, are checked, or are selected.
Usage:
// Count the number of input items that are filled-in
$(":filledIn").length;
*/
( function( $ ){
// custom selector determines if an element is filled-in, checked, or selected.
$.expr[":"].filledIn = function( a ){
@StevenBlack
StevenBlack / jquery.headersAboveBelow.js
Created March 15, 2010 17:19
:headerBelow and :headerAbove
// jQuery custom selectors for headers above (lower <h> tag) or below (higher <h> tag) given an arbitrary level
(function( $ ) {
$.extend($.expr[':'],{
// selects all the headers below the passed index. So 2 matches <h3>, <h4>, <h5>.
headerBelow: function( elem, i, match ) {
if ( /h\d/i.test( elem.nodeName ) ) {
var level= parseInt( match[ 3 ], 10 ) + 1, str = "h["+ level +"-5]", re = new RegExp( str, "i" ), ret ;
return re.test( elem.nodeName );
}
return false;
@StevenBlack
StevenBlack / jQuery page template
Created March 26, 2010 14:21
jQuery page template
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
@StevenBlack
StevenBlack / jQuery-UI page template
Created March 26, 2010 14:20
jQuery-UI page template
<!DOCTYPE html>
<html lang="en">
<head>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/redmond/jquery-ui.css" rel="stylesheet" />
<style>
body{ font: 75% "Trebuchet MS", sans-serif; margin: 50px;}
</style>
</head>
<body>
@StevenBlack
StevenBlack / roundCorner.js
Created April 9, 2010 22:24
Round corners plugin
/*
Rounded-corners plugin.
Origin: http://css-tricks.com/jquery-css-abstraction/
Usage:
$(function() {
$("p").roundCorner('50px');
});
@StevenBlack
StevenBlack / jquery.specialEvents.Example.js
Created April 10, 2010 01:51
jQuery special events example
// Special events
(function($){
// Special event definition.
$.event.special.click = {
setup: function() {
// This is only done the first time a "click" event handler is bound,
// per-element.
$(this).css( 'cursor', 'pointer' );