Skip to content

Instantly share code, notes, and snippets.

View cameronpriest's full-sized avatar

Cameron Priest cameronpriest

View GitHub Profile

freee API v1.0

全自動クラウド会計ソフトfreeeの開発者向けAPIのドキュメントです。

概要

本APIを利用することで、あなたのアプリやサービスをfreeeと連携させることができます。

提供機能(2013/10/10現在)

@taitems
taitems / Console Capture
Created August 15, 2011 02:34
Prevent console.log()s from causing JS errors
if (!window.console) {
window.console = {};
window.console.log = function() {
return false;
};
}
@colindensem
colindensem / couchdb_attachments.rb
Created July 24, 2011 09:53 — forked from wildchild/couchdb_attachments.rb
Serving CouchDB attachments with Rails 3
module CouchDBAttachments
def attachment(*args)
lambda do |env|
request = ActionDispatch::Request.new(env)
doc = DocWithAttachments.get(request.params[:doc])
serve_attachment(doc, request.params[:path])
end
end
private
@albertoleal
albertoleal / hook_inherited.rb
Created June 7, 2011 11:30
Getting all subclasses
class SimpleBaseClass
def self.inherited(new_subclass)
puts "Hey #{new_subclass} is now a sublcass of #{self}!"
end
end
class SubClass < SimpleBaseClass
end
@albertoleal
albertoleal / gist:987933
Created May 24, 2011 00:35
Avoid double-raised exception in Ruby
module NoDoubleRaise
def raise(*args)
if $! && args.first != $!
warn "There is already one exception #{caller.first} raised"
exit! false
else
super
end
end
end
# Copyright (c) Henry Poydar
# Modified from couchrest-rails
# A Rails plugin for connecting to and working with CouchDB via CouchRest
# https://github.com/hpoydar/couchrest-rails/
require 'sunspot_couch.rb'
begin
@amedeo
amedeo / gist:820412
Created February 10, 2011 12:00
CouchDB and multiple tags

CouchDB and multiple tags

The problem

Given a set of documents, each associated with multiple tags, how can I retrieve the documents tagged with an arbitrary set of tags?

My solution

@dawsontoth
dawsontoth / Geolocation.js
Created February 9, 2011 23:35
Constantly Updating Geolocation in Appcelerator Titanium
Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;
Titanium.Geolocation.distanceFilter = 0;
var win = Ti.UI.createWindow({backgroundColor: '#fff'});
var label = Ti.UI.createLabel();
win.add(label);
win.open();
function reportPosition(e) {
if (!e.success || e.error) {
@wrs
wrs / DeviseJsonAdapter.rb
Created December 8, 2010 18:02
JSON-encoded error and redirect results for Devise controllers
# JSON-encoded error and redirect results for Devise controllers.
# This overrides an internal method of Devise, so be careful when updating Devise!
#
# Usage:
#
# class Users::RegistrationsController < Devise::RegistrationsController
# include DeviseJsonAdapter
# end
#
# devise_for :users, :controllers => { :registrations => "users/registrations" }
var search = Titanium.UI.createSearchBar({
barColor:'#000',
showCancel:true,
height:43,
top:0
});
var tableView = Titanium.UI.createTableView({
top:40,
data:{title:'Please perform a search'}