View gist:75248
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this is a test |
View subfolders_by_exif_date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'fileutils' | |
require 'exifr' | |
ARGV.each do |file| | |
begin | |
date = EXIFR::JPEG.new(file).date_time_original | |
dir = sprintf('%04d-%02d-%02d', date.year, date.month, date.mday) | |
Dir.mkdir(dir) unless File.exist?(dir) |
View gist:133745
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'fileutils' | |
ARGV.each do |file| | |
begin | |
date = File.new(file).ctime | |
dir = sprintf('%04d-%02d-%02d', date.year, date.month, date.mday) | |
Dir.mkdir(dir) unless File.exist?(dir) | |
FileUtils.mv(file, dir) |
View gist:133747
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'fileutils' | |
ARGV.each do |file| | |
begin | |
date = File.new(file).mtime | |
dir = sprintf('%04d-%02d-%02d', date.year, date.month, date.mday) | |
Dir.mkdir(dir) unless File.exist?(dir) | |
FileUtils.mv(file, dir) |
View gist:133751
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
input = STDIN.isatty ? nil : STDIN.read | |
if input | |
IO.popen('pbcopy', 'w').print(input) | |
else | |
puts `pbpaste` | |
end |
View gist:133755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'utility' | |
file = File.open(File.join(ENV['HOME'], "events.txt"), "a") | |
t = Time.new | |
time = sprintf("%04d-%02d-%02d_%02d%02d%02d", t.year, t.month, t.day, t.hour, t.min, t.sec) | |
file.puts "#{time}\t#{ARGV.join(' ')}" |
View gist:133758
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl "http://is.gd/api.php?longurl=$(echo $@ | sed 's/\ /+/g')" |
View gist:133760
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/local/bin/perl | |
#Get command line options. | |
$wrap_column = $ARGV[0] || 60; | |
#Set up text wrap options. | |
use Text::Wrap; | |
use Text::Tabs; | |
$Text::Wrap::columns = $wrap_column; |
View gist:146565
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'utility' | |
input = STDIN.isatty ? nil : STDIN.read | |
if input | |
IO.popen('xclip -selection clipboard', 'w').print(input) | |
else | |
puts `xclip -selection clipboard -o` | |
end |
View gist:157908
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"> | |
<ShortName>Jay's Search</ShortName> | |
<Description>Google search with 100 results per page and keyboard shortcuts</Description> | |
<InputEncoding>UTF-8</InputEncoding> | |
<Url type="application/x-suggestions+json" method="GET" template="http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&hl={moz:locale}&q={searchTerms}&num=100&esrch=BetaShortcuts"/> | |
<Url type="text/html" method="GET" template="http://www.google.com/search"> | |
<Param name="q" value="{searchTerms}"/> | |
<Param name="ie" value="utf-8"/> | |
<Param name="oe" value="utf-8"/> | |
<Param name="aq" value="t"/> |
OlderNewer