Skip to content

Instantly share code, notes, and snippets.

View dwaynemac's full-sized avatar

Dwayne Macgowan dwaynemac

View GitHub Profile
[ec2-user@ip-10-29-27-56 contacts]$ gem install rmagick -v '2.13.2'
Fetching: rmagick-2.13.2.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
@dwaynemac
dwaynemac / batch_overlay_images.rb
Last active December 23, 2015 08:49
Script to add a watermark to a directory of images.
ORIGINAL_DIR= 'fotos'
OUTPUT_DIR = 'overlayed'
OVERLAY_FILE = 'overlay.png'
class Composer
def initialize(file_name)
@file_name = file_name
[2013-09-15 23:57:48] requirements_debian_update_system
requirements_debian_update_system ()
{
__rvm_try_sudo apt-get --quiet --yes update || {
typeset __ret=$?;
case ${__ret} in
100)
rvm_error "There has been error while updating 'apt-get', please give it some time and try again later.
For 404 errors check your sources configured in:
/etc/apt/sources.list
@dwaynemac
dwaynemac / error.log
Created August 16, 2013 18:51
este request envió mail con triggers que no corresponden a esa account
2013-08-16T15:15:48.402351+00:00 app[web.1]: Started GET "/message_door" for 50.17.15.145 at 2013-08-16 15:15:48 +0000
2013-08-16T15:15:48.566605+00:00 app[web.1]: LogicalModel Log: 200 https://padma-contacts.herokuapp.com/v0/contacts/520e4022618966000b0000e4?select%5B0%5D=email&app%5Fkey=[SECRET] in 0.144759s
2013-08-16T15:15:48.566605+00:00 app[web.1]: LogicalModel Log RESPONSE: {"_id":"520e4022618966000b0000e4","email":"[email protected]"}
2013-08-16T15:15:49.028961+00:00 app[web.1]: Processing by MessageDoorController#catch as */*
2013-08-16T15:15:49.028961+00:00 app[web.1]: Rendered text template (0.0ms)
2013-08-16T15:15:49.028961+00:00 app[web.1]: Completed 200 OK in 617ms (Views: 0.6ms | ActiveRecord: 277.5ms)
2013-08-16T15:15:49.028961+00:00 app[web.1]: Parameters: {"key_name"=>"communication", "data"=>"{\"account_name\":\"oeste_go\",\"avoid_mailing_triggers\":false,\"communicated_at\":\"2012-12-26T23:00:00Z\",\"contact_id\":\"520e4022618966000b0000e4\",\"created_at\":\"2013-08-16T15:0
class Direction
attr_accessor :current
def initialize(dir = nil)
@current = dir
end
def current
@current ||= :forward
end
mongodb: ~/mongodb/bin/mongod
contacts: subcontract --rvm '1.9.2' --chdir ../contacts -- bundle exec unicorn -p 3002 -c ./config/unicorn.rb
activitystream: subcontract --rvm '1.9.2' --chdir ../activity_stream -- bundle exec unicorn -p 3003 -c ./config/unicorn.rb
accounts: subcontract --rvm 'ruby-1.9.3-p392' --chdir ../accounts -- bundle exec rails s -p 3001
@dwaynemac
dwaynemac / google_contacts_client.rb
Created March 15, 2013 15:27
Google Contacts Clinet
require 'gdata'
class GoogleContactsClient
def initialize(username, password)
@username = username
@password = password
@client = GData::Client::Contacts.new
PadmaContact.search(ids: a,username:'luis.perichon',account_name:'martinez2112052')
LogicalModel Log: 200 https://padma-contacts-staging.herokuapp.com/v0/contacts/search in 0.132849s
LogicalModel Log RESPONSE: {"collection":[],"total":0}
=> []
2012-12-11T13:33:52+00:00 app[web.1]:
2012-12-11T13:33:52+00:00 app[web.1]:
2012-12-11T13:33:52+00:00 app[web.1]: Started GET "/v0/contacts?per%5Fpage=1000&where%5Blocal%5Fstatus%5Ffor%5Fmatosinhos%5D=student&where%5Bglobal%5Fteacher%5Fusername%5D=pedro%2Emar&page=1&app%5Fkey=844d8c2d20a9cf9e97086df94f01e7bdd3d9afaa716055315706f2e31f40dc097c632af53e74ce3d5a1f23811b4e32e7a1e2b7fa5c128c8b28f1fc6e5a392015" for 50.16.118.56 at 2012-12-11 13:33:52 +0000
2012-12-11T13:33:52+00:00 app[web.1]: Processing by V0::ContactsController#index as */*
2012-12-11T13:33:52+00:00 app[web.1]: Parameters: {"per_page"=>"1000", "where"=>{"local_status_for_matosinhos"=>"student", "global_teacher_username"=>"pedro.mar"}, "page"=>"1", "app_key"=>"844d8c2d20a9cf9e97086df94f01e7bdd3d9afaa716055315706f2e31f40dc097c632af53e74ce3d5a1f23811b4e32e7a1e2b7fa5c128c8b28f1fc6e5a392015"}
2012-12-11T13:33:52+00:00 heroku[router]: at=info method=GET path=/v0/contacts?per%5Fpage=1000&where%5Blocal%5Fstatus%5Ffor%5Fmatosinhos%5D=student&where%5Bg
@dwaynemac
dwaynemac / application_controller.rb
Created August 21, 2012 18:06
Typhoeus Arrays decoding in Rails
require 'typhoeus/arrays_decoder'
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :decode_typhoeus_arrays
private
def decode_typhoeus_arrays