Skip to content

Instantly share code, notes, and snippets.

View lukeredpath's full-sized avatar
🏠
Working from home

Luke Redpath lukeredpath

🏠
Working from home
View GitHub Profile
(in /Users/luke/Code/clients/topsecretproject)
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 100 | 79 | 8 | 13 | 1 | 4 |
| Helpers | 3 | 2 | 0 | 0 | 0 | 0 |
| Models | 237 | 187 | 6 | 31 | 5 | 4 |
| Libraries | 266 | 232 | 12 | 18 | 1 | 10 |
| Integration tests | 487 | 371 | 7 | 6 | 0 | 59 |
| Functional tests | 112 | 84 | 3 | 0 | 0 | 0 |
require 'fileutils'
REPORT_FOLDER = Pathname.new('/Users/luke/Documents/Business/Accounts/iTunes Finance Reports')
@agent = ITunesConnect::Agent.new
@agent.sign_in!('[email protected]', 'yourpassword')
begin
if @agent.signed_in?
@downloaded = 0
require 'rubygems'
require 'restclient'
require 'crack'
require 'mash'
require 'active_support'
RestClient::Resource.class_eval do
def root
self.class.new(URI.parse(url).merge('/').to_s, options)
end
require File.join(File.dirname(__FILE__), *%w[freeagent freeagent])
require 'ostruct'
require 'erb'
require 'tempfile'
MY_USER_ID = 2383
freeagent = FreeAgent::Company.new(ENV['FA_COMPANY'], ENV['FA_USERNAME'], ENV["FA_PASSWORD"])
class ExpensesReport
//
// MusicServiceItemTest.m
// Squeemote
//
// Created by Luke Redpath on 08/02/2010.
// Copyright 2010 LJR Software Limited. All rights reserved.
//
#include "TargetConditionals.h"
@lukeredpath
lukeredpath / LICENSE
Last active March 22, 2020 08:21
A decorator around UILocalizedIndexedCollation that automatically adds the search icon. Updated to support ARC.
Copyright (c) 2010 Luke Redpath
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
class Asset < ActiveRecord::Base
belongs_to :task
validate :task_belongs_to_creator
attr_accessor :creator
private
def task_belongs_to_creator
if creator && task.user != creator
* In response to user feedback, Squeemote has an updated control mechanism; single-tap now plays automatically whilst tap-and-hold presents a contextual menu.
* Improved support for large libraries; Squeemote now downloads album lists in smaller incremental chunks.
* Improved artwork handling; artwork is no longer downloaded whilst the album list is scrolling due to its impact on performance but there is now an option to pre-cache artwork (disabled by default). Scrolling performance in the album view is improved in general.
* Improved caching strategy with the ability to refresh individual lists (including shake to refresh).
* Better notification of download progress when fetching large libraries (animated progress view).
* Dramatically improved music service support, including Napster, Rhapsody and Pandora. Tested with all of the major music services but should work with all. Better handling of display of music service items including information such as artist bios.
* New Music screen moved into its own tab
require 'rest_client'
require 'json'
require 'active_support/all'
def wiki(action, params={})
params.merge!(:action => action, :format => 'json')
headers = {"User-Agent" => "Ruby Wikipedia Client", "Accept" => "application/json"}
RestClient.get("http://en.wikipedia.org/w/api.php?#{params.to_query}", headers) do |response|
JSON.parse(response.body)
end
def assert_select_elements_in_order(selector, values, options={})
options.reverse_merge!(:starting_from_index => 1)
values.each_with_index do |value, index|
position = options[:starting_from_index] + index
assert_select "#{selector}:nth-of-type(#{position})", value,
"Expected value at #{selector}:(n=#{position}) to be #{value}"
end
end