Skip to content

Instantly share code, notes, and snippets.

View borismacias's full-sized avatar
👨‍🍳
🥖

Boris Macias borismacias

👨‍🍳
🥖
View GitHub Profile
@borismacias
borismacias / country-code-to-currency-code-mapping.csv
Last active February 24, 2019 23:13 — forked from HarishChaudhari/country-code-to-currency-code-mapping.csv
Country, Country Code, Currency code mapping in CSV format Taken from https://gist.github.com/304261 Contains 249 countries.
Country CountryCode Currency Code
New Zealand NZ New Zealand Dollars NZD
Cook Islands CK New Zealand Dollars NZD
Niue NU New Zealand Dollars NZD
Pitcairn PN New Zealand Dollars NZD
Tokelau TK New Zealand Dollars NZD
Australian AU Australian Dollars AUD
Christmas Island CX Australian Dollars AUD
Cocos (Keeling) Islands CC Australian Dollars AUD
Heard and Mc Donald Islands HM Australian Dollars AUD
@borismacias
borismacias / 0_reuse_code.js
Created December 14, 2015 23:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@borismacias
borismacias / filedownloader.js
Created July 6, 2016 18:20 — forked from DavidMah/filedownloader.js
File Download requests using jquery/POST request with psuedo ajax
// Takes a URL, param name, and data string
// Sends to the server.. The server can respond with binary data to download
jQuery.download = function(url, key, data){
// Build a form
var form = $('<form></form>').attr('action', url).attr('method', 'post');
// Add the one key/value
form.append($("<input></input>").attr('type', 'hidden').attr('name', key).attr('value', data));
//send request
form.appendTo('body').submit().remove();
@borismacias
borismacias / rails_setup.md
Created April 26, 2017 16:38 — forked from kjs222/rails_setup.md
Common setup for a new Rails project
  1. rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T
  • -d postgresql sets up the project to use PostgreSQL
  • --skip-turbolinks & --skip-spring creates a project that does not use turbolinks or spring
  • -T skips the creation of the test directory and use of Test::Unit
  1. In the Gemfile:
  • Available to all environments:
    • gem 'figaro' - store environment variables securely across your app (docs)
    • Uncomment gem 'bcrypt', '~> 3.1.7' if you will be hosting your own user accounts with passwords (docs)
  • Inside of group :test:
    • gem 'rspec-rails' - user rspec in place of minitest (docs)
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@borismacias
borismacias / Untitled-1
Created June 25, 2018 21:45
Remove docker dangling images
docker rmi $(docker images -q -f dangling=true)
@borismacias
borismacias / docker-compose-pry.md
Last active June 26, 2018 16:14
Docker run with PRY
@borismacias
borismacias / fintual-rubocop.yml
Created October 2, 2018 16:22
"Updated" rubocop file for Fintual rubocop@0.49.0 works with VSCODE!
AllCops:
Include:
- "**/*.rake"
- "**/Gemfile"
- "**/Rakefile"
Exclude:
- "vendor/**/*"
- "db/**/*"
- "bin/**/*"
DisplayCopNames: false
@borismacias
borismacias / canelita.rb
Last active January 10, 2019 02:14
Snippet para la ansiedad de Canelita
require 'shellwords'
ROOT_PATH = '/Users/boris/Desktop/canelita'.freeze
sounds = Dir["#{ROOT_PATH}/sonidos/*"]
loop do
sound = Shellwords.shellescape sounds.sample
puts "PLAYING #{sound}"
`omxplayer #{sound}`