Skip to content

Instantly share code, notes, and snippets.

@danfinnie
danfinnie / archive.rb
Last active August 29, 2015 14:23
Move files into directories based on dates in filenames
require 'fileutils'
require 'securerandom'
require 'pp'
require 'shellwords'
=begin
Given pictures in subdirectories structured as year/month/date/picture.jpg,
output year-month-date.tar.bz2.gpg and keys.txt.
Where:
@danfinnie
danfinnie / gist:9424998
Created March 8, 2014 03:42
Rotation Matrix
def cos *args
Math.cos(*args)
end
def sin *args
Math.sin(*args)
end
def funky_func(theta)
proc do |x, y|
@danfinnie
danfinnie / patch
Created August 28, 2013 22:34
Converting an existing Rails project to raise Bullet errors in test.
---
Gemfile | 2 +-
Gemfile.lock | 14 ++++++++++----
config/environments/test.rb | 5 +++++
4 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/Gemfile b/Gemfile
index 9a4481a..1a6982f 100644
--- a/Gemfile
+++ b/Gemfile
@danfinnie
danfinnie / git-history.html.erb
Created February 27, 2013 19:25
Git History Analyzer
<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.