Skip to content

Instantly share code, notes, and snippets.

@ROldford
ROldford / Parse Start and Due Dates.applescript
Last active August 18, 2024 13:02 — forked from theconektd/Parse Start and Due Dates.applescript
A script to add due and start date support to TaskPaper, forked from the script by andyferra. See http://www.hogbaysoftware.com/wiki/StartAndDueDatesV2 for more information.
(*
Parse Start and Due Dates script
By Ryan Oldford
Based on work by andyferra (https://gist.github.com/andyferra/64842)
change_case taken from http://www.macosxautomation.com/applescript/sbrt/sbrt-06.html
This script is used with TaskPaper to provide better start and due date support, as well as support for repeating tasks.
The script searches for @due and @start tags, converts their values to standard date code values,
then adds the appropriate "diff" tag whose value indicates how far away the due or start date is (negative = past, 0 = today).
Any tasks with a @repeat tag that are done are edited to remove the done tag and have their due tags updated.
# Script posted at: http://n8henrie.com/2013/02/quickly-import-pythonista-scripts-via-textexpander-or-bookmarklet
# Script name: Import Pythonista Script from Clipboard
# I got help from here: http://twolivesleft.com/Codea/Talk/discussion/1652/what-others-do%3A-pythonista/p1
# I got help from here: http://www.macdrifter.com/2012/09/pythonista-trick-url-to-markdown.html
import clipboard
import urllib2
import editor
import os
@poritsky
poritsky / paste-selected-file.applescript
Created March 14, 2013 16:24
For use with TextExpander. Get contents of selected file, copy and paste. I have it set with ",,pbpaste" in TextExpander.
tell application "Finder"
set sel to the selection as text
set fPath to quoted form of POSIX path of sel
do shell script ("cat " & fPath & " | pbcopy && pbpaste")
end tell
@ttscoff
ttscoff / chgext.sh
Created March 14, 2013 00:08
One-line Bash command to change the extensions of all files in a directory
# batch change extension
chgext() {
for file in *.$1 ; do mv $file `echo $file | sed "s/\(.*\.\)$1/\1$2/"` ; done
}
@ttscoff
ttscoff / lsz.sh
Last active February 20, 2025 09:59
A bash function that lists the contents of various types of archives. Easier to remember, faster to type.
# ls archives (inspired by `extract`)
lsz() {
if [ $# -ne 1 ]
then
echo "lsz filename.[tar,tgz,gz,zip,etc]"
return 1
fi
if [ -f $1 ] ; then
case $1 in
*.tar.bz2|*.tar.gz|*.tar|*.tbz2|*.tgz) tar tvf $1;;
@colindean
colindean / Armory
Last active December 14, 2015 18:48 — forked from bsmt/Armory
#!/bin/bash
cd "${0%/*}"
export DYLD_LIBRARY_PATH=../Dependencies/QtCore.framework/Versions/Current:../Dependencies/QtGui.framework/Versions/Current:../Dependencies:$DYLD_LIBRARY_PATH
bin/python armorybuild/ArmoryQt.py &
@bsmt
bsmt / Armory
Last active December 14, 2015 18:38
Package Armory into an app bundle for OS X.
#!/bin/bash
cd "${0%/*}"
export DYLD_LIBRARY_PATH=../Dependencies/QtCore.framework/Versions/Current:../Dependencies/QtGui.framework/Versions/Current:../Dependencies:$DYLD_LIBRARY_PATH
bin/python armorybuild/ArmoryQt.py &
@tzarskyz
tzarskyz / hack.sh
Created March 9, 2013 05:39 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
<?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>NSWorkspace</key>
<key>SystemConfiguration</key>
<dict>
<key>State:/Network/Global/IPv4</key>
<dict>
<key>command</key>
@rbsgn
rbsgn / gist:5089314
Last active December 14, 2015 12:49
Shell script to open Xcode workspace or project from terminal.
#!/bin/bash
find_project_or_workspace() {
MASK=$1
ALL_PROJECTS_OR_WORKSPACES=`/bin/ls -1 -d $MASK 2>/dev/null`
FILE_TO_OPEN=''
if [ z"${ALL_PROJECTS_OR_WORKSPACES}" != z ] ; then
for i in ${ALL_PROJECTS_OR_WORKSPACES} ; do
if [ z"${PROJECT}" == z ] ; then