Skip to content

Instantly share code, notes, and snippets.

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

Boris Macias borismacias

👨‍🍳
🥖
View GitHub Profile

Keybase proof

I hereby claim:

  • I am borismacias on github.
  • I am bjobim (https://keybase.io/bjobim) on keybase.
  • I have a public key ASDWN6mSMKZwVmCy2gx63zmKmdg-yU-6xd4kmo3CZLqFeAo

To claim this, I am signing this object:

@borismacias
borismacias / configuration.yml
Created January 10, 2019 02:25
HASS config
script:
talk_canelita:
sequence:
- service: shell_command.talk_canelita
stop_talking:
@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}`
@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 / docker-compose-pry.md
Last active June 26, 2018 16:14
Docker run with PRY
@borismacias
borismacias / Untitled-1
Created June 25, 2018 21:45
Remove docker dangling images
docker rmi $(docker images -q -f dangling=true)

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

=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')
@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)
@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();