Skip to content

Instantly share code, notes, and snippets.

View ushu's full-sized avatar

Aurélien Noce ushu

View GitHub Profile
.ir {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
.ir {
text-indent: 9999px;
}
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
# based on http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
# this is the aggregate of several sources so still messy
.DS_Store
.Trashes
*.swp
*.lock
*~.nib
DerivedData/
build/
@ushu
ushu / BigNavBar.h
Created August 13, 2013 12:24
Increase the height of the UINavigationBar
#import <UIKit/UIKit.h>
@interface BigNavBar : UINavigationBar
@end
@ushu
ushu / main.cc
Created October 28, 2013 10:39
UVA basic
#include <iostream>
#include <string>
std::string compute(std:string in) {
return "";
}
int main() {
while(true) {
std::string input;
@ushu
ushu / S3 buckets copy.md
Created October 29, 2013 16:12
Copy between S3 buckets w/ different accounts

This is a mix between two sources:

basically the first resource is great but didn't work for me: I had to remove the trailing "/*" in the resource string to make it work. I also noticed that setting the policy on the source bucket was sufficient. In the end these are the exact steps I followed to copy data between two buckets on two accounts

Basically the idea there is:

  • we allowe the destination account to read the source bucket (in the console for the source account)
  • we log as the destination and start the copy
@ushu
ushu / Cucumber: test omniauth login
Last active December 27, 2015 09:39
tags for omniauth: @fake_google_user etc.
Feature: Authentication
@fake_facebook_user
Scenario: I log in with my facebook account
Given I just arrived to the Website
And I log in using facebook
Then I see the Home Page
@ushu
ushu / Rails: DevelopmentMailInterceptor
Last active December 28, 2015 10:08
Rails mailer interceptor for DEV
# lib/development_mail_interceptor.rb
# copied from some RailsCast (could not remember the #...)
# expects a DEVELOPMENT_REDIRECT_EMAIL env var
class DevelopmentMailInterceptor
def self.delivering_email(message)
message.subject = "#{message.to} #{message.subject}"
message.to = ENV['DEVELOPMENT_REDIRECT_EMAIL']
end
end
@ushu
ushu / Rails: SendGrid initializer
Last active December 28, 2015 10:08
Rails: SendGrid settings
# config/initializers/sendgrid.rb
ActionMailer::Base.smtp_settings = {
:user_name => ENV['SENDGRID_USER'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'herokuapp.com',
:address => 'smtp.sendgrid.net',
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true
}