Skip to content

Instantly share code, notes, and snippets.

@patrickwelker
patrickwelker / responsive-iframes.css
Created March 5, 2012 12:47 — forked from aarongustafson/responsive-iframes.css
Responsive iFrames with jQuery
iframe {
max-width: 100%;
}
@patrickwelker
patrickwelker / gist:2405115
Created April 17, 2012 10:26 — forked from rfbrazier/gist:1077160
Create an OmniFocus task from the current URL of the active Chrome tab
tell application "Google Chrome"
set theTitle to title of active tab of front window
set theURL to URL of active tab of front window
end tell
tell application "OmniFocus"
set theDoc to default document
set theTask to theTitle
set theNote to theURL
@patrickwelker
patrickwelker / Railscast2.tmTheme
Created July 19, 2012 20:51 — forked from smlombardi/Railscast2.tmTheme
Modified version of Railscast theme for Textmate/Sublime Text 2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Railscasts 2</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@patrickwelker
patrickwelker / jekyll-localized-date
Created September 18, 2012 13:09
Localized date via replace in Jekyll (Example: German)
<time datetime="{{ post.date | %Y-%m-%d %H:%M+01:00 }}">
{{ post.date | date: "%d. %B %Y" | replace:"January","Januar" | replace:"Februar","February" | replace:"March","März" | replace:"May","Mai" | replace:"June","Juni" | replace:"July","Juli" | replace:"December","Dezember" }}
</time>
@patrickwelker
patrickwelker / Simple share buttons
Created January 23, 2013 17:36
Simple social share buttons for WordPress. It's worth a mention that if you use certain themes, they might use a special `%permalink%` and `%post-title%` structure. Be sure to replace the default `<?php the_title(); ?>` and `<?php the_permalink(); ?>` with it. #Facebook #Twitter #Google+
<a title="Share" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>">Share on Facebook</a>
<a title="Tweet" href="https://twitter.com/share?url=&text=<?php the_title(); ?>: <?php echo urlencode(get_permalink($post->ID)); ?> &via=YOUR-TWITTER-USERNAME&count=horizontal">Tweet This</a>
<a title="PlusOne" href="https://plusone.google.com/_/+1/confirm?hl=en&url=<?php the_permalink(); ?>">+1</a>
-----------------------------------------------------
-- Name: Edit Last Modified Note and Preview in Marked
-- Author: Patrick Welker <http://rocketink.net>
-- Version: 1.1 (October 24, 2014)
-- Credits: Uses ViewInMarked by Robin Trew to align editor and Marked windows: <http://git.io/sLxcgg>
-- For: bloggers, writers and Marked users (<http://markedapp.com>)
-----------------------------------------------------
-- Know problems:
-- * Sometimes, when the editor is closed it first tries top open the default "open" dialog.
-- * The script handles nvALT differently from all editors. It doesn't resize nvALT's window since most users
@patrickwelker
patrickwelker / gollum.sh
Last active December 27, 2015 16:19
Script for starting a gollum wiki (from anywhere) in the background when developing with RVM.
#!/bin/bash
# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
# Then try to load from a root install
@patrickwelker
patrickwelker / command.js
Last active December 28, 2015 07:29 — forked from JoelBesada/README.md
GrabLinks Backtick
(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading&hellip;</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://gist.github.com/ttscoff/5834741/raw/grablinks.js?x="+(Math.random());})();
@patrickwelker
patrickwelker / createFolderTreeInCurrentFinderWindow.applescript
Created November 27, 2013 08:51
AppleScript to create a folder tree like that from Photo Mechanic.
tell application "Finder" to set currentPath to (target of front Finder window) as text
set createFolders to "mkdir SELECTS && mkdir MASTERS && mkdir WEB && mkdir PRINT"
do shell script "cd " & (quoted form of POSIX path of currentPath) & "; " & createFolders
@patrickwelker
patrickwelker / markdown2evernote.sh
Created December 21, 2013 08:54
A script for Martin Kopischke's old version of the Evernote to Markdown conversion script. See: <http://nsuserview.kopischke.net/post/6223792409/i-can-has-some-markdown>
#!/usr/bin/env bash
fillText(){
echo "Notebook: ${1}"
echo "Title: ${2}"
echo "Url: ${3}"
echo "Keywords: ${4}"
echo
echo "## [∞ Permalink](${3})"
echo "## [➡︎ Safari](launchpro://?url=${3})"