Skip to content

Instantly share code, notes, and snippets.

View davidnunez's full-sized avatar

David Nuñez davidnunez

View GitHub Profile
(*
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.
@davidnunez
davidnunez / gist:1043316
Created June 23, 2011 19:02
Optimized Eyeball Clock Array init
// initializes your array
$newcolori = array();
// - for loop will repeat everything inside the '{...}' a certain number of times
// - i starts at 0 ('i=0')
// - i increases by 1 every time the loop repeats 'i++'
// - the for loop will repeat as long as i is less than or equal to 60 (starts at 0 goes up to 59) 'i<=60'
for (i=0;i<=60;i++)
{
// - i is just like any other variable here... it just changes on every loop
@davidnunez
davidnunez / gist:1341680
Created November 5, 2011 15:41
Timelapse script
while true ; do sleep 60 && echo `date`‘ Capturing screenshot…’ && screencapture -C -m -t jpg -x -f cap.`date +%s`.jpg ; done
@davidnunez
davidnunez / quix.txt
Created January 26, 2012 14:57
davidnunez quix
@Text tools
@Markdown and text manipulation tools
ml javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}prompt('Markdown%20Link','['+s+']('+location+')')})();void(0) Copy selected text as Markdown link
mt javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}prompt('Markdown%20Title','['+document.title+']('+location+')')})();void(0) Copy title as Markdown link
mu javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}prompt('Markdown%20URL','('+location+')')})();void(0) URL as markdown link
mc javascript:(function(s){try{s=document.selection.createRange().text}catch(_){s=document.getSelection()}prompt('Markdown%20Copy','['+document.title+']('+location+')\n\n>'+s)})();void(0) Copy selected text as quote with title url in markdown
tc javascript:(function(s){try{s=document.selection.crea
@davidnunez
davidnunez / gist:1741710
Created February 5, 2012 01:10
SSH trick: pipe microphone input of one machine to the speakers of another machine
dd if=/dev/dsp | ssh -C user@host dd of=/dev/dsp
@davidnunez
davidnunez / gist:2001851
Created March 8, 2012 16:18
Ruby: getting random line from file
line = IO.readlines('some_file')
c = rand*line.length.to_i
puts line[c-1]
@davidnunez
davidnunez / Log to Day One.scpt
Created May 9, 2012 18:08 — forked from jeredb/Log to Day One.scpt
Based on Brett Terpstra's Log Taskpaper Archives to Day One, except for Omnifocus.
(*
Jered Benoit
jeredb.com
Omnifocus -> Day One Daily Completed Task Log
Based upon [Version 1.0] [1] of [OmniFocus - Weekly Project Report Generator] [2]
Originally Authored by Chris Brogan and Rob Trew
February 5, 2012
@davidnunez
davidnunez / gitlogger.rb
Created May 14, 2012 08:01 — forked from ttscoff/gitlogger.rb
Archive marked git repositories daily commits to Day One and/or text file
#!/usr/bin/ruby
require 'time'
require 'erb'
filename = "~/.gitlogger"
## File format, One per line
# Repo Name:/path/to/base
dayone = true # log to day one? (true or false)
textlog = "~/Dropbox/nvALT2.2/GitLogger.md" # set to false to disable
@davidnunez
davidnunez / gitlogger-install.rb
Created May 14, 2012 08:00 — forked from ttscoff/gitlogger-install.rb
Installer for gitlogger.rb
#!/usr/bin/ruby
require 'ftools'
puts "Installing GitLogger"
puts "This script will install the following files:"
puts
puts "/usr/local/bin/gitlogger.rb"
puts "~/Library/LaunchAgents/com.brettterpstra.gitlogger.plist"
puts "It will add the glog command to your bash_profile and"
@davidnunez
davidnunez / gist:2795676
Created May 26, 2012 23:59
Script that copies selected items in omnifocus to a format suitable for pasting in my nvalt system
property newContextName : "txfr" --context the item will change to if changeContext = true
tell application "Finder"
set the clipboard to ""
end tell
tell application "OmniFocus"