Skip to content

Instantly share code, notes, and snippets.

View karlhorky's full-sized avatar

Karl Horky karlhorky

View GitHub Profile
@karlhorky
karlhorky / api.json
Created October 25, 2015 11:55
saasquatch-cli API Configuration
{
"defaultResponse": {
"totalAccepted": 1,
"totalRejected": 0,
"accepted": [
{ "address": "[email protected]" }
],
"rejected": []
},
"exchanges": [
@karlhorky
karlhorky / gist.js
Created September 1, 2015 14:58
Copy to Clipboard
(function() {
top !== window && (alert("For security reasons, framing is not allowed."),
top.location.replace(document.location))
}
).call(this),
function() {
var t, e, n;
n = function(t) {
var e, n, r;
return e = $("meta[name=hostname]").attr("content"),
@karlhorky
karlhorky / migrate-repo-to-lfs.sh
Last active February 28, 2019 07:42
Migrate existing design git repo to large file storage with history
git filter-branch --prune-empty --tree-filter '
git lfs track "*.ai"
git lfs track "*.psd"
git lfs track "*.eps"
git lfs track "*.jpg"
git lfs track "*.png"
git lfs track "*.svg"
git add .gitattributes
git ls-files -z | xargs -0 git check-attr filter | grep "filter: lfs" | sed -E "s/(.*): filter: lfs/\1/" | tr "\n" "\0" | while read -r -d $'"'\0'"' file; do
@karlhorky
karlhorky / epub.sh
Last active August 29, 2015 14:27 — forked from ilyakava/epub.sh
Input an arg of a file of a list of links, get an output.epub of all those webpages concatenated
#!/bin/bash
COUNT=1
for link in $(cat $1)
do
wget -O - -o /dev/null $link | iconv -f iso8859-1 -t utf-8 > $COUNT.html
COUNT=$(echo $COUNT + 1 |bc)
done
@karlhorky
karlhorky / variables.json
Created July 27, 2015 12:34
Dynamic JSON Schema Defaults
{
"title": "root",
"type": "object",
"definitions": {
"emailShareSubject": {
"type": "string",
"description": "Email share subject",
"minLength": 4
},
"emailShareSubjectCREDIT": {
@karlhorky
karlhorky / server.js
Created July 17, 2015 15:01
Simple File Upload with Express
var express = require('express'),
busboy = require('connect-busboy'),
app = express(),
fs = require('fs'),
router = express.Router();
router.get('/', function(req, res) {
res.send('<form action="" method="post" enctype="multipart/form-data"><input type="file" name="displayImage"><input type="submit" name="Upload"></form>');
});
@karlhorky
karlhorky / autocomplete.controller.js
Last active December 21, 2016 21:39
Directive class extending with ECMAScript 6
class AutocompleteController {
constructor () {
'ngInject';
}
querySearch (query) {
return this.service.search(query);
}
selectedItemChange(item) {
@karlhorky
karlhorky / Monokai (Block Cursor Everywhere).tmTheme
Last active March 8, 2025 22:31
Custom Block Cursor Color Scheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai</string>
<key>settings</key>
<array>
<dict>
<key>name</key>

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@karlhorky
karlhorky / README.md
Last active August 29, 2015 14:16
Template Inheritance for Handlebars (thejohnfreeman.com)

Template Inheritance for Handlebars

23 MAR 2012

Archived from http://thejohnfreeman.com/blog/2012/03/23/template-inheritance-for-handlebars.html

Handlebars is a member of the family of "logic-less" template systems born from Mustache. I will not describe the merits of logic-less templates in this post. (If you are unfamiliar with them, then please visit either of the two links at the beginning of this paragraph.) Rather, I want to describe a simple technique for extending Handlebars with template inheritance.

The goal