Skip to content

Instantly share code, notes, and snippets.

View dkarter's full-sized avatar

Dorian Karter dkarter

View GitHub Profile
@dkarter
dkarter / File Drop Experiment.css
Created February 19, 2015 20:14
File Drop Experiment
.dropbox {
border: dashed 2px #666;
height: 30px;
width: 240px;
border-radius: 20px;
text-align: center;
padding-top: 10px;
color: #666;
transition: height .5s ease;
}
@dkarter
dkarter / File Drop Experiment.js
Created February 19, 2015 20:15
File Drop Experiment JS
$(document).on('dragenter', function (){
$('.dropbox').height(300);
$('.drag-mask').show();
});
$('.drag-mask').on('dragleave', function () {
$('.dropbox').height(30);
$('.drag-mask').hide();
});
@dkarter
dkarter / Handlebars-+jQuery-Multiple-File-Upload.markdown
Last active August 29, 2015 14:17
Handlebars +jQuery Multiple File Upload
Users/dkarter/dev/app/path/ruby/2.2.0/gems/json-1.8.2/lib/json/ext/parser.bundle: [BUG] Segmentation fault at 0x00000000000440
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
@dkarter
dkarter / path.sh
Created October 24, 2015 18:58
PrettyPrint $PATH with awk
echo $PATH | awk '{ n = split($0, paths, ":"); for (i=0; ++i <= n;) print i, paths[i] }'
@dkarter
dkarter / RoundRobin.Elm
Last active January 6, 2016 23:04
Round Robin Elm
module RoundRobin where
import Graphics.Element exposing (show)
import Set
import Array
type alias Team = String
type alias TeamMatch = (Team, Team)
removeRedundentMatches : List TeamMatch -> List TeamMatch
@dkarter
dkarter / say.sh
Created October 24, 2015 19:00
OS X `Say` voices try out
echo 'Agnes'
say -v 'Agnes' "Isn't it nice to have a computer that will talk to you?"
echo 'Albert'
say -v 'Albert' "I have a frog in my throat. No, I mean a real frog!"
echo 'Alex'
say -v 'Alex' "Most people recognize me by my voice."
echo 'Alice'
say -v 'Alice' "Salve, mi chiamo Alice e sono una voce italiana."
echo 'Alva'
say -v 'Alva' "Hej, jag heter Alva. Jag är en svensk röst."
@dkarter
dkarter / .projections.json
Created April 18, 2016 16:02
Rails SQL Migration Projections
{
"db/migrations/*.rb": {
"type": "migration",
"template": [
"class {camelcase} < ActiveRecord::Migration",
" def up",
" execute <<-SQL",
" SQL",
" end",
"",
@dkarter
dkarter / Elm Soup To Nuts.md
Last active May 14, 2016 17:39
Elm Soup to Nuts

To review please fork, make your changes and post the link to your fork in the comments. Thanks much!!

Elm by Example - Soup to Nuts: Building a Slack inspired Channel Switcher

Part 1

By now you have probably heard about Elm, the statically typed, immutable, Haskell inspired, polite and helpful, functional reactive language for the web.

It's extremely FAST too. It consistently performs better than React, Ember, Angular and others in the TODO MVC performance tests.

@dkarter
dkarter / Project initialization.sh
Last active June 12, 2016 02:26
Script for fast bootstrapping of a new project
function mkcd () {
mkdir -p $1 && cd $1
}
function initprj() {
if [[ "$1" != "." ]]; then
mkcd $1
fi
# setup git