Skip to content

Instantly share code, notes, and snippets.

View timhaines's full-sized avatar

Tim Haines timhaines

View GitHub Profile
require "nestful"
require "roauth"
def upload(path_to_file)
twitpic_key = "my_twitpic_api_key"
oauth_url = "https://api.twitter.com/1/account/verify_credentials.json"
oauth = {
:access_key => "account_access_key",
:access_secret => "account_access_secret",
@timhaines
timhaines / resque_retry.rb
Created September 9, 2011 06:17 — forked from PatrickTulskie/resque_retry.rb
Retry failed Resque jobs in Ruby
# inspired by http://ariejan.net/2010/08/23/resque-how-to-requeue-failed-jobs
# retry all failed Resque jobs except the ones that have already been retried
# This is, for instance, useful if you have already retried some jobs via the web interface.
Resque::Failure.count.times do |i|
Resque::Failure.requeue(i) unless Resque::Failure.all(i, 1)['retried_at'].present?
end
# retry all :)
Resque::Failure.count.times do |i|

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@timhaines
timhaines / controllers.application.js
Last active April 8, 2017 01:24 — forked from samselikoff/mirage.config.js
Mirage dev boilerplate
import Ember from 'ember';
export default Ember.Controller.extend({
});
@timhaines
timhaines / mirage.config.js
Last active April 16, 2017 14:55
Mirage Dev Boilerplate
export default function() {
//window.server = this;
this.get('users');
};
@timhaines
timhaines / lambda.js
Created January 11, 2019 17:32 — forked from luketheobscure/lambda.js
Percy Bitbucket AWS Lambda
const https = require('https');
const AUTHORIZATION = ''; // base 64 of user:password
const BITBUCKET_USER = ''; // either the user or the org that owns the repo
const PERCY_USER = ''; // the name of your percy user or org
exports.handler = (event, context, callback) => {
/**
We need to post to a URL like this:
https://api.bitbucket.org/2.0/repositories/<user>/<repo>/commit/<hash>/statuses/build