Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
Not your keys, not your coins.

Steven Black StevenBlack

🤔
Not your keys, not your coins.
View GitHub Profile
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 / 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 -->
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 / 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
@StevenBlack
StevenBlack / filledIn.js
Created Jan 31, 2010
jqueyt.filledin.js
View 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 Mar 15, 2010
:headerBelow and :headerAbove
View jquery.headersAboveBelow.js
// 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;
View 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>
View 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 Apr 9, 2010
Round corners plugin
View roundCorner.js
/*
Rounded-corners plugin.
Origin: http://css-tricks.com/jquery-css-abstraction/
Usage:
$(function() {
$("p").roundCorner('50px');
});
View jquery.specialEvents.Example.js
// 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' );
You can’t perform that action at this time.