Skip to content

Instantly share code, notes, and snippets.

View rdeguzman's full-sized avatar

Rupert de Guzman rdeguzman

View GitHub Profile
@rdeguzman
rdeguzman / _form.html.erb
Created December 5, 2012 22:35
formtastic
<%= semantic_form_for @fleet_group do |f| %>
<div class="column left">
<section>
<% unless params[:action] == "edit" %>
<%= f.input :id, :label => "Fleet Group ID" %>
<% end %>
<%= f.input :schema_name, :hint => "dfms_[fleet_group_id]", :label => "Schema Name" %>
namespace :queue do
#task :stop do
# run "sh #{deploy_to}/current/tools/queue_stop.sh"
#end
task :start do
#run "/usr/local/rvm/bin/rvm-shell 'ruby-1.9.3-p0@dfms' -c 'RAILS_ENV=production nohup /usr/local/datalink/dfms-rails/current/bin/worker/geocoder_queue &'"
run "sh #{deploy_to}/current/tools/queue_start.sh"
end
end
@rdeguzman
rdeguzman / tasks
Created April 27, 2012 21:31
MyTravelPhilippines Android Task List
Total: 19-20 days
1. http://developer.android.com. (1-2 days)
- Download SDK. http://dl.google.com/android/android-sdk_r18-macosx.zip
- Prep dev environment
- Need to register like Apple iOS Developer $99/year?
2. Get an Android device? (optiional?)
- Heck, why did I sell the HTC desire.
- Device mostly used in PH/Asia? Im guessing Samsung Galaxy?
@rdeguzman
rdeguzman / 1-dmesg
Created April 3, 2012 02:18
Get sierra wireless MC8790 working on lucid 5.2.8
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for Sierra USB modem
sierra 1-7:1.0: Sierra USB modem converter detected
usb 1-7: Sierra USB modem converter now attached to ttyUSB0
sierra 1-7:1.1: Sierra USB modem converter detected
usb 1-7: Sierra USB modem converter now attached to ttyUSB1
sierra 1-7:1.2: Sierra USB modem converter detected
Started GET "/notices" for 127.0.0.1 at 2012-02-29 15:02:14 +1100
Processing by NoticesController#index as HTML
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 8 LIMIT 1
Role Load (0.5ms) SELECT "roles".* FROM "roles" INNER JOIN "roles_users" ON "roles".id = "roles_users".role_id WHERE "roles"."name" = 'AdminSuper' AND ("roles_users".user_id = 8 ) LIMIT 1
Role Load (0.7ms) SELECT "roles".* FROM "roles" INNER JOIN "roles_users" ON "roles".id = "roles_users".role_id WHERE "roles"."name" = 'ClientAdmin' AND ("roles_users".user_id = 8 ) LIMIT 1
Role Load (0.5ms) SELECT "roles".* FROM "roles" INNER JOIN "roles_users" ON "roles".id = "roles_users".role_id WHERE "roles"."role_type" = 'admin' AND ("roles_users".user_id = 8 ) LIMIT 1
Client Load (0.3ms) SELECT "clients".* FROM "clients" WHERE "clients"."id" = 63 LIMIT 1
Rendered layouts/_header.datatables.html.erb (2.0ms)
SQL (0.3ms) SELECT COUNT(*) FROM "notices" INNER JOIN "clients_notices" ON "notices".id = "clients_notices"
@rdeguzman
rdeguzman / Gemfile
Created February 28, 2012 02:33
ruby1.9.3 + growl1.2 -> guard start -> fail
source 'http://rubygems.org'
gem 'rails', '3.0.10'
gem 'mysql2', '< 0.3'
gem 'pg'
gem 'devise'
gem 'jquery-rails'
gem 'simple-navigation'
gem 'cancan'
gem 'formtastic', "2.0.2"
@rdeguzman
rdeguzman / gist:1756976
Created February 7, 2012 03:32
RVM + RUBY + RAILS core dumped
This is now solved in freenode@irc#rvm by mpapis. Try ruby-1.9.3-p0!!!! Thank you to mpapis
FreeBSD9 64 bit + rvm + ruby1.9.2-p180 + rails3.0.10
[root@rufus /usr/local/datalink/cws-rails]# uname -a
FreeBSD rufus.datalink.loc 9.0-STABLE FreeBSD 9.0-STABLE #0: Thu Jan 19 09:10:51 EST 2012 root@rufus.datalink.loc:/usr/obj/usr/src/sys/RUFUS amd64
[root@rufus /usr/local/datalink/cws-rails]# rails s -e development
=> Booting WEBrick
=> Rails 3.0.10 application starting in production on http://0.0.0.0:3000
@rdeguzman
rdeguzman / gist:1538064
Created December 30, 2011 05:28
Calling a python module from postgres function
CREATE FUNCTION pymax (a integer, b integer)
RETURNS integer
AS $$
if a > b:
return a
return b
$$ LANGUAGE plpythonu;
SELECT pymax(1,2) #=> 2
@rdeguzman
rdeguzman / install
Created December 19, 2011 01:04
brew install php --with-apache --with-mysql FAILS!
/usr/local/Cellar[master]% brew install gmp
==> Downloading http://ftpmirror.gnu.org/gmp/gmp-5.0.2.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/gmp/5.0.2 --enable-cxx --build=x86_64-apple-darwin
==> make
==> make install
==> make check
/usr/local/Cellar/gmp/5.0.2: 11 files, 2.4M, built in 3.2 minutes
brew install gmp 158.17s user 68.52s system 116% cpu 3:14.86 total
/usr/local/Cellar[master]% brew install php --with-apache --with-mysql
#import "HJImageView.h"
#import "JSONKit.h"
#import "ASIHTTPRequest.h"
#import "Country.h"
#import "ApplicationConstants.h"
#import "MainTableViewConstants.h"