Skip to content

Instantly share code, notes, and snippets.

View danheberden's full-sized avatar

Dan Heberden danheberden

View GitHub Profile
@dherman
dherman / cat.js
Last active December 25, 2015 16:01
comparing different iteration protocols
// EXAMPLE: a compound iterator with sequencing
// Python style
function cat() {
let is = arguments;
return {
next: {
let length;
while ((length = is.length) > 0) {
try {
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@garann
garann / gist:3353532
Created August 14, 2012 22:23
Crowdsourced career mentorship for female developers

I was inspired by Selena Deckelmann's list of Career Resources for Women (http://www.chesnok.com/daily/career-resources-for-women/), but couldn't think of much to contribute. So I thought maybe those of us already in the field and in a position to mentor could work on creating more. Please fork or comment and add your own!

Also: there is a wealth of info online and elsewhere dating back to the first time it occurred to our species to exchange labor for currency on these topics in general. What I hope we can provide here is our take as individuals. What we would say to someone if we were sitting across from her acting as a mentor. I don't think we should worry about being objectively "right", or about duplicating topics. I add this bit of anti-editorializing in hopes that women will contribute without feeling pressured to be experts, which I worry might prevent them from doing so. TY. :)

Applying for jobs

@cowboy
cowboy / ditto.txt
Created June 4, 2012 17:39
IRC: ditto
<iros> qunit question - I have some behavior I want to test that is only important before DOM ready... is there a way to do that with qunit?
<tbranyen> iframe
<danheberden> ditto
<ben_alman> ditto to whom
<danheberden> it that isn't apparent, then it's of no consequence
<ben_alman> stop avoiding the question
<danheberden> avoidance is only discerned when the answer sought isn't received
<ben_alman> ditto my previous statement; also note the qualification of said ditto
<iros> lol
<ben_alman> ditto, iros
@cowboy
cowboy / lock-screen.sh
Created April 21, 2011 17:13
OS X: Start screensaver + lock screen (bind to a hotkey with a utility, or run via Launchbar / QuickSilver)
#!/bin/bash
sleep 0.5 && open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app
@danheberden
danheberden / Quewery 1.0
Created April 1, 2011 17:35
A selector engine
var Quewery = function( selector ) {
if( selector.match(/#[^\s]+$/) ) {
return [ document.getElementById( selector.substring(1) ) ];
} else {
return document.querySelectorAll( selector );
}
}
@danheberden
danheberden / 4 Digit Time
Created March 6, 2011 01:15
Gets 4 digit time (hhmm) with optional time frame flooring (e.g. 0317 => 0315 )
/*
* Returns a 4 digit string of the time in hhmm format
* timeFrame will floor to the nearest multiple, e.g.
* fourDigitTime( 15, '', 2, 44 ); // returns "0230"
* hr and min will use the current time if not specified
* sep ( the separator between the hours and minutes ) defaults
* to an empty string ('')
*
* (c) Dan Heberden - danheberden.com
* https://gist.github.com/856911
@danheberden
danheberden / gyazo.php
Created February 17, 2011 06:20 — forked from cowboy/gyazo.php
<?PHP
/*
* PHP upload for Gyazo - v1.2 - 02/16/2011
* http://benalman.com/news/2009/10/gyazo-on-your-own-server/
*
* Copyright (c) 2009 "Cowboy" Ben Alman
* Licensed under the MIT license
* http://benalman.com/about/license/
*/
@endolith
endolith / Has weird right-to-left characters.txt
Last active April 7, 2024 01:38
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶