Skip to content

Instantly share code, notes, and snippets.

@imakewebthings
imakewebthings / gist:65c2dc7cddec4f350a56adc2a6e957ed
Last active May 23, 2022 18:34 — forked from asabaylus/gist:3071099
Github Markdown Heading Anchors

test.thing

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)

[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
[user]
name = imakewebthings
email = caleb@imakewebthings.com

Keybase proof

I hereby claim:

  • I am imakewebthings on github.
  • I am imakewebthings (https://keybase.io/imakewebthings) on keybase.
  • I have a public key whose fingerprint is D71B E8A8 E7A9 462D D30C 29C7 DF86 985F C87D 3C40

To claim this, I am signing this object:

$(document).on('deck.beforeChange', function(event, from, to) {
var $slides = $.deck('getSlides');
var onLastSlide = from === $slides.length - 1;
var onFirstSlide = !from;
var goingForward = to > from;
if (onLastSlide && goingForward) {
event.preventDefault();
$.deck('go', 0);
}
$(document).on('deck.beforeChange', function(event, from, to) {
var $slides = $.deck('getSlides');
var onLastSlide = from === $slides.length - 1;
var onFirstSlide = !from;
var goingForward = to > from;
var nextUrl = $('link[rel="next"]').attr('href');
var prevUrl = $('link[rel="prev"]').attr('href');
if (onLastSlide && goingForward && nextUrl) {
window.location = nextUrl;
import random
class FileHandler(object):
def __init__(self, filename = "", query_type = ""):
self.filename = filename
self.query_type = query_type
def line_from_file(self, filename=None, query_type=None):
if filename != None
@imakewebthings
imakewebthings / gist:7016319
Last active December 25, 2015 17:49
deck revised extension example: goto
(function($, undefined) {
$.deck('extend', {
name: 'goto',
options: {
class: 'deck-goto',
datalistSelector: '#goto-datalist',
formSelector: '.goto-form',
inputSelector: '#goto-slide',
countNested: true
@imakewebthings
imakewebthings / gist:5658875
Created May 27, 2013 20:14
Super simple notify
var notify = function(message) {
var $message = $('<p style="display:none;">' + message + '</p>');
$('.notifications').append($message);
$message.slideDown(300, function() {
window.setTimeout(function() {
$message.slideUp(300, function() {
$message.remove();
});
}, 2000);
@imakewebthings
imakewebthings / gist:2881369
Created June 6, 2012 11:29
Super quick and dirty, maybe not even functional, progress bar example for deck.js
/* Add this to bottom of deck container
<div class="deck-progress"><span></span></div>
And add this CSS wherever:
.deck-progress {
position:absolute;
left:0;
right:0;
bottom:0;
@imakewebthings
imakewebthings / deck.processing.js
Created May 20, 2012 03:18
One possible way to run/destroy processing sketches on deck.change
$(document).bind('deck.init', function() {
$.each(Processing.instances, function(i, instance) {
instance.exit(); // Exit all drawings to start
});
});
$(document).bind('deck.change', function(event, from, to) {
var $exitingCanvases = $.deck('getSlide', from).find('canvas[data-processing-sources]');
var $enteringCanvases = $.deck('getSlide', to).find('canvas[data-processing-sources]');