Skip to content

Instantly share code, notes, and snippets.

View patrickkettner's full-sized avatar

patrick kettner patrickkettner

View GitHub Profile
var D = app.activeDocument;
var links = {};
var saveDateString = '';
var calendarData = {};
var calendar = new Window( 'dialog', 'calendar' );
calendar.MonthAndYear = calendar.add('group');
var MonthAndYear = calendar.MonthAndYear;
var allMonths = ["January", "Feburary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
This file has been truncated, but you can view the full file.
//
// jsh
// Launch a window for interactively executing JavaScript commands
//
// $Id$
// Copyright: (c)2007, xbytor
// License: http://www.opensource.org/licenses/bsd-license.php
// Contact: xbytor@gmail.com
//
app;
@patrickkettner
patrickkettner / dabblet.css
Created April 10, 2013 09:44 — forked from LeaVerou/dabblet.css
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
@patrickkettner
patrickkettner / dabblet.css
Created April 10, 2013 09:45
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
#Block the APNIC range of IP addresses - a common source of hacking attempts
sudo ipfw -q add deny src-ip 43.0.0.0/8
sudo ipfw -q add deny src-ip 58.0.0.0/8
sudo ipfw -q add deny src-ip 59.0.0.0/8
sudo ipfw -q add deny src-ip 60.0.0.0/8
sudo ipfw -q add deny src-ip 61.0.0.0/8
sudo ipfw -q add deny src-ip 110.0.0.0/8
sudo ipfw -q add deny src-ip 111.0.0.0/8
sudo ipfw -q add deny src-ip 112.0.0.0/8
@patrickkettner
patrickkettner / pre-commit
Last active December 19, 2015 15:38
white space pre-commit removal
#!/usr/bin/env bash
if git rev-parse --verify HEAD >/dev/null 2>&1 ; then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
# Find files with trailing whitespace
# Doubled commands are _linux_version_ || _mac_osx_version_
@patrickkettner
patrickkettner / Emulator Guide.md
Created August 23, 2013 20:56
Quick guide on settings up emulators for various mobile platforms.
#!/usr/bin/env bash
PULL_REQUEST=$(git describe --all --contains $1 | cut -d '~' -f 1)
LAST_PULL_REQUEST=$(echo ^$PULL_REQUEST | awk '{sub(/[0-9]+/, substr($0, match($0, /[0-9]+/)) - 1); print }')
PULL_REQUEST_NUMBER=$(echo $PULL_REQUEST | awk -F/ '{print $NF}');
echo "
$(git config --get remote.origin.url | cut -d '.' -f 1-2)/pull/$PULL_REQUEST_NUMBER
"
git --no-pager log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative $PULL_REQUEST $LAST_PULL_REQUEST --no-merges
@patrickkettner
patrickkettner / penzoom.js
Created September 21, 2013 05:11
codepen zoomer
var $results = $('#result_div');
var button = document.createElement('button');
button.className = 'top-button button';
button.innerHTML = 'Zoom';
var toggleZoom = function() {
var result_height = $results.attr('data-height');
$('.top-boxes, .resizer').toggle();
@patrickkettner
patrickkettner / prepare-commit-msg
Last active July 19, 2016 22:23
This git hook appends "[ci skip]" to your commit message if the readme file is the only thing being touched. Read more about it here - http://about.travis-ci.org/docs/user/how-to-skip-a-build/
#!/usr/bin/env bash
# a list of all files that are changing with this commit
FILES_CHANGING=$(git diff --cached --name-only --diff-filter=ACM)
# if there is only one file changing
if [ $(echo "$FILES_CHANGING" | wc -l) -eq 1 ]; then
# and that file is a readme
README_CHANGING=$($FILES_CHANGING | grep -Ei "readme(.md|.txt)?$")