Skip to content

Instantly share code, notes, and snippets.

View emiltin's full-sized avatar

Emil Tin emiltin

  • City of Copenhagen
  • Denmark
  • 09:57 (UTC +02:00)
View GitHub Profile
#heroku console, looks ok?
irb(main):007:0> UserMailer.activation(22).deliver
EmailAuthentication Load (31.7ms) SELECT "authentications".* FROM "authentications" WHERE "authentications"."type" IN ('EmailAuthentication') AND "authentications"."id" = $1 LIMIT 1 [["id", 22]]
User Load (8.9ms) SELECT "users".* FROM "users" WHERE "users"."id" = 22 LIMIT 1
=> #<Mail::Message:34436900, Multipart: false, Headers: <Date: Tue, 19 Jun 2012 18:46:36 +0000>, <from: auto@http://ibikecph-staging.herokuapp.com>, <To: emil@tin.dk>, <Message-ID: <4fe0c90c7bb97_2ba219c157c7@c14a21c1-685b-44fd-8081-aca8d93041df.mail>>, <Subject: Activating your Social Lab account>, <Mime-Version: 1.0>, <Content-Type: text/plain>, <Content-Transfer-Encoding: 7bit>>
irb(main):008:0> ActionMailer::Base.smtp_settings
=> {:address=>"smtp.sendgrid.net", :port=>"587", :authentication=>:plain, :user_name=>"xxxxxxx@heroku.com", :password=>"xxxxxxxx", :domain=>"heroku.com"}
irb(main):009:0>
Process: osrm-routed [96734]
Path: /Users/USER/*/osrm-routed
Identifier: osrm-routed
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: sh [96733]
Date/Time: 2012-06-12 17:13:29.251 +0200
OS Version: Mac OS X 10.7.4 (11E53)
Report Version: 9
~/Project-OSRM$ ((8ddb3fc...)) git fetch upstream
~/Project-OSRM$ ((8ddb3fc...)) git checkout upstream/master
HEAD is now at 8ddb3fc... Implements feature request from issue #256
~/Project-OSRM$ ((8ddb3fc...)) scons --clean
scons: Reading SConscript files ...
Using default C++ Compiler: g++
Checking for C header file omp.h... yes
Checking for C++ library bz2... yes
Checking for C++ library png... yes
Checking for C++ library zip... yes
@emiltin
emiltin / gist:2863812
Created June 3, 2012 14:52
osrm-prepare samling
Sampling process 63503 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling osrm-prepare (pid 63503) every 1 millisecond
Process: osrm-prepare [63503]
Path: /Users/emil/code/Project-OSRM/osrm-prepare
Load Address: 0x100000000
Identifier: osrm-prepare
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: gdb-i386-apple-darwin [63491]
@emiltin
emiltin / gist:2724033
Created May 18, 2012 08:41
cancan authorizing object depening on parent resource
#theme.rb
class Theme < ActiveRecord::Base
belongs_to :challenge
end
#challenge.rb
class Challenge < ActiveRecord::Base
has_many :themes
has_many :roles, :as => :managed, :dependent => :destroy
end
#config/environment/production.rb
#i'm deploying on Heroku, using Sendgrid, which works fine for other emails.
MyApp::Application.config.middleware.use ExceptionNotifier,
:email_prefix => "[Exception] ",
:sender_address => %{"notifier" <auto@mydomain.com>},
:exception_recipients => %w{me@mydomain.com}
When I route I should get # features/step_definitions/routing.rb:169
| from | to | route |
| a | b | ab | <-- green
| a | c | ca | <-- green
| b | c | bc | <-- green
| b | a | ab | <-- yellow
| c | a | ca | <-- yellow
| b | a | bc,ca | <-- grey
| c | b | bc | <-- yellow
| c | a | ca | <-- grey
Scenario Outline: Implied oneways
Given the defaults
#ways must be constructed and preprocess as a whole beforehand...
And the ways
| highway | junction |
| motorway | |
| motorway_link | |
| trunk | |
| trunk_link | |
if i create a new rails 3 app and define this in my application controller:
def index
logger.error 'xxxxxx logger'
render :text => 'logger'
end
then visiting the root url of my heroku app writes this to the log file:
2011-11-13T09:24:46+00:00 app[web.1]: Started GET "/" for 212.60.120.210 at 2011-11-13 09:24:46 +0000
~/osm$ brew install --use-gcc --enable-cxx https://raw.github.com/emiltin/homebrew-alt/master/duplicates/gcc.rb
######################################################################## 100.0%
==> Downloading ftp://ftp.gnu.org/gnu/gcc/gcc-4.6.0/gcc-4.6.0.tar.bz2
File already downloaded in /Users/emil/Library/Caches/Homebrew
==> --enable-fully-dynamic-string
==> ../configure --enable-languages=c,c++ --prefix=/usr/local/Cellar/gcc/4.6.0/gcc --datarootdir=/usr/local/Cellar/gcc/4.6.0/share --bindir=
==> make bootstrap
echo stage3 > stage_final
mkdir build-x86_64-apple-darwin11.1.0
mkdir build-x86_64-apple-darwin11.1.0