Skip to content

Instantly share code, notes, and snippets.

View davidnunez's full-sized avatar

David Nuñez davidnunez

View GitHub Profile
@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:1328533
Created October 31, 2011 19:08
Install all apks in a folder to android device
for f in *.apk; do echo "Processing $f"; adb install $f;done
@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 / gist:1404789
Created November 29, 2011 13:20
list all installed packages in android adb shell
pm list packages -f
@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-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 / 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