Skip to content

Instantly share code, notes, and snippets.

View gustin's full-sized avatar
🦁
Happy

gustin gustin

🦁
Happy
View GitHub Profile
test
In 2008 WHO malnutrition expert Francesco Branca cited the lack (in 2008) of
real-world studies and uncertainty about how many people will use golden rice,
concluding "giving out supplements, fortifying existing foods with vitamin A,
and teaching people to grow carrots or certain leafy vegetables are, for now,
more promising ways to fight the problem".[41]
launchers:
integration:
command: "rspec testing/integration"
headless:
command: "HEADLESS=1 rspec testing/integration"
src_files:
- testing/integration/*.rb
- app/webroot/js/src/global.js
test_page: app/webroot/js/SpecRunner.html
launch_in_dev:
module MyApp
module Database
def connect(pool_size = nil, reap_time = nil)
return unless defined? ActiveRecord::Base
config = Rails.application.config.database_configuration[Rails.env]
config['reaping_frequency'] = reap_time || ENV['AR_DB_REAP_FREQ'] || 10 # seconds
config['pool'] = pool_size || ENV['AR_DB_POOL'] || 5
ActiveRecord::Base.establish_connection(config)
end
@gustin
gustin / application.js
Last active August 29, 2015 14:07
Oxfam Action Block
var purpose = new Purpose({
account: "oxfam",
url: "http://oxfam.api.staging.purpose.com/en"
});
purpose.attach();
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests
@gustin
gustin / gist:369eae3779522cd4e46a
Last active August 29, 2015 14:08
Locale Config
new Purpose({
account: 'oxfam',
url: 'http://oxfam.api.movements.purpose.com',
locale: 'es' // can be retrieved from cookie, or page url, or added by affiliate CMS, or anywhere really
}).attach();
When starting a project that includes refinerycms-blog:
$ rake refinery:override view=refinery/pages/*
$ rake refinery:override view=layouts/*
$ rake refinery:override view=refinery/blog/shared/*
$ rake refinery:override view=refinery/blog/posts/*
$ rake refinery:override view=refinery/*
$ rake refinery:override controller=refinery/blog/*
$ rake refinery:override controller=refinery/*
<label>
<span>País</span>
<select class="select-styled" id="member_info_country_iso" name="country_iso" required="required">
<option data-uses-postcode="false" value="af">Afghanistan</option>
<option data-uses-postcode="false" value="al">Albania</option>
<option data-uses-postcode="true" value="dz">Algeria</option>
<option data-uses-postcode="true" value="as">American Samoa</option>
<option data-uses-postcode="true" value="ad">Andorra</option>
<option data-uses-postcode="false" value="ao">Angola</option>
<option data-uses-postcode="false" value="ai">Anguilla</option>
@gustin
gustin / gist:aa7c87c5baad66638fb4
Last active August 29, 2015 14:15
Oxfam Belgium
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>purpose.js</title>
<script src="./purpose.min.js"></script>
<link rel="stylesheet" href="./purpose.css">
<script>
"use strict";
var purpose = new Purpose({