Skip to content

Instantly share code, notes, and snippets.

View itspriddle's full-sized avatar
🤘
clickity clack

Joshua Priddle itspriddle

🤘
clickity clack
View GitHub Profile
# Print the list of special characters used with strftime
def print_strftime_keys
now = Time.parse('2010-06-01')
('A'..'Z').to_a.each do |letter|
[letter, letter.downcase].each do |l|
time = now.strftime("%#{l}")
puts "'#{l}' => '#{time}'"
end
end
end
@Burgestrand
Burgestrand / download-progress.rb
Created June 27, 2010 13:55
Ruby HTTP file download with progress measurement
require 'net/http'
require 'uri'
def download(url)
Thread.new do
thread = Thread.current
body = thread[:body] = []
url = URI.parse url
Net::HTTP.new(url.host, url.port).request_get(url.path) do |response|
[alias]
# git browse
# Opens origin in web browser
#
# Ex:
# git@myhostname.com:my/repo.git => http://myhostname.com/my/repo
# git://myhostname.com/my/repo.git => http://myhostname.com/my/repo
# http[s]://myhostname.com/my/repo.git => http://myhostname.com/my/repo
browse = !open $( \
echo \"`git config remote.origin.url`\" | \
// RATER MODULE for Appcelerator Titanium
/*
WHAT IS IT:
Create a cycling reminder to go rate your app at the App Store. Tracks
the app launch count, and reminds the user every 20 launches (configurable) to
rate the app, with a click to launch the app page in the App Store.
Reminders stop if the user clicks the "Rate Now" or "Don't Remind Me" options.
USAGE:
# Put this in app/metals/api.rb
require 'sinatra/base'
class Api < Sinatra::Base
before do
content_type :json
authenticate if api_request?
end
#
# Titanium Mobile Rake tasks
#
# Validate and launch your Titanium Mobile application via Rake
#
# Edit Application::COMPILER if not using OS X
# Requires jsl (install on OS X via homebrew with `brew install jsl`)
#
# Only supports iPhone right now.
#

Creative and Technical Services Agreement

This CREATIVE AND TECHNICAL SERVICES AGREEMENT (“Agreement”) is an agreement between Joshua Priddle, (“Developer”) and the party set forth in the Project Estimate (“Customer” or “you” or “your”) incorporated herein by this reference and applies to the purchase of all services ordered by Customer (collectively, the “Services”). The parties understand, acknowledge and agree that this is an online agreement which is being entered into in conjunction with the Services.

<?php
function generate_password($length = 10)
{
$password = "";
$letters = array(
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B',
'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9'
My Old Cell Phone Usage
Received Calls: 24:24:39
Dialed Calls: 21:56:11
All Calls: 57:18:20
Transmit Data: 12,033 KB
Received Data: 9,743 KB
Total: 21,776 KB
class Integer
def to_minutes
min = (self / 60.floor)
sec = (self - (min * 60)).round
"%0-2d:%0-2d" % [min, sec]
end
end