Skip to content

Instantly share code, notes, and snippets.

View oliverbarnes's full-sized avatar

Oliver Azevedo Barnes oliverbarnes

View GitHub Profile
@dcrec1
dcrec1 / centos
Last active March 24, 2017 11:52
ubuntu/centos nginx
cd /tmp
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
rpm -Uhv rpmforge-release*.rf.i386.rpm
yum install readline-dev htop
@oliverbarnes
oliverbarnes / dragonfly_with_image_name_in_url.rb
Created March 22, 2011 00:20
Finding dragonfly image with cucumber/capybara
#config
app.url_path_prefix = '/images'
#route
match '/images/:dragonfly/:file_name', :to => Dragonfly[:images]
#model
class Store
include MongoMapper::Document
key :photo_uid, String
@krsmurata
krsmurata / rails_admin.pt-BR.yml
Created February 16, 2012 13:09 — forked from lribeiro/rails_admin.pt-PT.yml
Portuguese (pt-BR) translation for RailsAdmin 3.2
pt-BR:
views:
admin:
home:
name: Home
pagination:
previous: "« Anterior"
next: "Próximo »"
truncate: "…"
misc:
@holin
holin / Omniauth Twitter Hash
Created March 27, 2012 08:19 — forked from charliemoseley/Omniauth Twitter Hash
Twitter Authentication hash
--
provider: twitter
uid: '15280529'
info:
  nickname: penguinbusiness
  name: Charlie Moseley
  location: Bellevue, WA
  image: http://a1.twimg.com/profile_images/281933747/kitamura_ava_normal.gif
  description: Developer, Otaku, Geek.
  urls:
--
provider: twitter
uid: '15280529'
info:
  nickname: penguinbusiness
  name: Charlie Moseley
  location: Bellevue, WA
  image: http://a1.twimg.com/profile_images/281933747/kitamura_ava_normal.gif
  description: Developer, Otaku, Geek.
  urls:
@kenliu
kenliu / binding-pry.sublime-snippet
Last active October 7, 2015 19:06
binding-pry.sublime-snippet
<snippet>
<content><![CDATA[
binding.pry
]]></content>
<tabTrigger>bp</tabTrigger>
<scope>source.ruby</scope>
</snippet>
import Stream from 'ember-cli-i18n/utils/stream';
import t from 'ember-cli-i18n/utils/t';
import Ember from 'ember';
// tHelper without the container and application dependencies, sigh...
function tHelper(params /*, hash, options, env */) {
var path = params.shift();
var stream = new Stream(function() {
return t(path, params);
@jamesmartin
jamesmartin / application_controller.rb
Created May 25, 2015 01:47
Testing ApplicationController before_filter methods using RSpec's "anonymous" controller instance
class ApplicationController < ActionControllerBase
helper :do_something
def do_something
@from_do_something = params[:for_do_something]
end
end
# # Fixing key bindings for `irb`
#
# when your ruby comes from `brew`, `rbenv`, and arrow keys don't work in your `irb`
brew upgrade readline rbenv ruby-install # ensure we have the `readline` library, and a recent version of `ruby-install` which will link to it properly when building `ruby`.
rbenv install <your-favourite-ruby-version> # rebuild ruby.
# watch out for the message 'ruby-build: use readline from homebrew' in output from the command above,
# then, go get some coffee.
# ...
@jinjagit
jinjagit / api.iex.exs
Last active July 3, 2020 15:31
adds aliases to iex shell for liquidvoting API
# adds aliases and imports a / some module(s) to iex shell for liquidvoiting API
# rename to .iex.exs and place in API project root
# for dev environment, not production - add to / don't remove from your local gitignore
# <alias ... as> used to avoid referencing other module with name equivalent to alias
import Ecto.Query
alias LiquidVoting.Application, as: App
alias LiquidVoting.{
Delegations,