Skip to content

Instantly share code, notes, and snippets.

View aitor's full-sized avatar
👊
Working!

Aitor García Rey aitor

👊
Working!
View GitHub Profile
@aitor
aitor / authenticate_user_spec.rb
Last active July 23, 2019 16:59
Service / Usecase Objects in vanilla Ruby
describe AuthenticateManagerService do
subject(:context) { described_class.call(username, password) }
describe '.call' do
context 'when the context is successful' do
let(:username) { 'correct_user' }
let(:password) { 'magic' }
it 'succeeds' do
expect(context).to be_success
// Source at https://developer.paypal.com/js/pages/docs/integration/direct/identity/lipp-button.js
//...
function _getConfig() {
var confObj = {};
var builders = buildForm.querySelectorAll('input, select');
var i = 0;
var el;
@aitor
aitor / asdf_elixir.sh
Created December 31, 2018 12:34
POWERLEVEL9K custom elixir/erlang prompt segment
POWERLEVEL9K_ELIXIR_ICON=$'\ue62d'
prompt_asdf_elixir() {
if [ $commands[asdf] ]; then
ELIXIR_ICON=$'\ue62d'
local asdf_global_conf="$HOME/.tool-versions"
local version_regex="s/^\([.0-9]*\).*/\1/p"
local config_regex="s/.*(set by \(.*\))/\1/p"
local elixir_current="$(asdf current elixir)"
local elixir_current_version="$(echo $elixir_current | sed -n $version_regex)"
@aitor
aitor / 20160307172445_change_paperclip_attachment_path.rb
Created November 20, 2018 11:47 — forked from 121onto/20160307172445_change_paperclip_attachment_path.rb
Example migration for changing paperclip storage path
class MoveAttachmentsToNewLocation < ActiveRecord::Migration
def initialize(name = self.class.name, version = nil)
access_key = Rails.application.secrets.g3_access_key_id
secret_key = Rails.application.secrets.g3_secret_access_key
storage = Fog::Storage::Google.new google_storage_access_key_id: access_key,
google_storage_secret_access_key: secret_key
@bucket_name = Rails.application.secrets.g3_bucket
@bucket = storage.directories.get(@bucket_name)
super(name, version)
@aitor
aitor / notification_flood.rb
Last active January 26, 2017 17:32 — forked from mort/Fighting notification flood with the alea gem
Fighting notification flood with the alea gem
# Activity streams' notifications to third parties are cool because they bring
# a feeling of a shared public space and increase the chance serendipitous findings
# But too much information quickly becomes noise, and relevant bits of news can
# disappear among a tsunami of irrelevant (to me) "x did y with z'
# What we're trying to do here is going from deterministic notifications
# (stuff happens, stuff gets broadcasted) to stochastic ones (stuff happens,
# stuff may gets broadcasted)
@aitor
aitor / README.md
Last active August 3, 2016 22:55 — forked from syntagmatic/README.md
Nutrition Parallel Sets
› heroku run script/console
Running `script/console` attached to terminal... up, run.5405
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
Error: Operation timed out - connect(2) (Errno::ETIMEDOUT)
Backtrace: /Users/aitor/.heroku/client/lib/heroku/client/rendezvous.rb:40:in `initialize'
/Users/aitor/.heroku/client/lib/heroku/client/rendezvous.rb:40:in `open'
/Users/aitor/.heroku/client/lib/heroku/client/rendezvous.rb:40:in `block in start'

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@aitor
aitor / css
Created February 27, 2013 20:16
/*
Syntax error: An @import loop has been found: /Users/aitor/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zurb-foundation-3.2.5/lib/../scss/foundation/functions/modular-scale.scss imports itself
on line 3 of /Users/aitor/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zurb-foundation-3.2.5/lib/../scss/foundation/functions/modular-scale.scss
from line 3 of /Users/aitor/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zurb-foundation-3.2.5/lib/../scss/foundation/functions/modular-scale.scss
1: // Legacy support since modular scale
2: // used to reside directly within Foundation
3: @import "modular-scale";
Backtrace:
@aitor
aitor / gist:5029549
Last active December 14, 2015 04:39
Proposal for DareConf 2013 http://dareconf.com

Digital Legacies and Death

Primary theme: Vulnerability and courage

Talk description

I want to talk about Death.

If there is one thing that has caused fear in every living creature from dawn of history to present day is death. Fear and pain are the basis for our self-preservation instincts but accepting our own mortality is so hard that we've created a whole set of "immortality systems" -national identities, art, religion, work and social structures- to delude ourselves (cf. Ernest Becker) and forget we're mortal.