Skip to content

Instantly share code, notes, and snippets.

View blackjid's full-sized avatar
🎹

Juan Ignacio Donoso blackjid

🎹
View GitHub Profile
@blackjid
blackjid / Readme.md
Last active February 23, 2022 01:34
Rails abort if pending migrations with data

Abort if pending migrations with data

We use the awesome gem data-migrate with comes with a handy rake task to check if you have migrations pending. The task is really and extention to the task built in on rails but that also check for pending data migrations.

That rake task is available since version 6.3.0 of data-migrate. If you are stuck in an older version like I was here is a version of the rake task you can put in your project.

rake db:abort_if_pending_migrations:with_data

Code Review y Pull Requests

Outline

  • Code review = Pull requests En platanus nuestra herramienta principal para hacer code reviews son los pull requests.
  • Por que hacemos code review
    • Encontrar bugs
      • Pero ojo que esto es limitado, unit tests y static analyzer tools (linters) son mucho mejores.
  • Force the discussion and vetting of code design
ENV['RAILS_ENV'] = ARGV[0] || 'production'
DIR = File.dirname(__FILE__)
require DIR + '/config/environment'
class PriceLoader
include PricingLogger
def load
log_start_proccess
PriceChange.where(realm: nil).order("price_changed_at").find_each do |price_change|
@blackjid
blackjid / update-multi.sh
Last active January 4, 2017 01:39
Update heroku multibuildpack on all your apps
#!/bin/bash
request=$(heroku apps --json)
apps=$(echo $request | jq -r '.[] | select(.buildpack_provided_description=="Multipack").name')
for i in $apps;
do
echo $i
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi.git --app $i
done
@blackjid
blackjid / 0_reuse_code.js
Created September 9, 2016 21: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

Keybase proof

I hereby claim:

  • I am blackjid on github.
  • I am blackjid (https://keybase.io/blackjid) on keybase.
  • I have a public key whose fingerprint is 757E 3CF8 FEA0 5AB7 5A64 674D D8CA 2216 DC8C 02DD

To claim this, I am signing this object:

@blackjid
blackjid / noroot-ams.js
Created October 6, 2015 23:39
Rootless Ams Style for Restmod
angular.module('restmod').factory('RootlessAMSApi', ['restmod', 'inflector', function(restmod, inflector) {
return restmod.mixin({ // include default packer extension
$config: {
style: 'AMS',
primaryKey: 'id',
jsonMeta: 'meta',
jsonLinks: 'links'
},
app:
image: platanus/hound
ports:
- 3000
volumes:
- /usr/src/app
links:
- db
- redis
env_file: .env.production
@blackjid
blackjid / docker-compose.yml
Last active August 29, 2015 14:27
Hound with Docker and Rancher
app:
ports:
- 3000/tcp
environment:
CHANGED_FILES_THRESHOLD: '300'
ENABLE_HTTPS: 'no'
EXEMPT_ORGS: platanus
GITHUB_CLIENT_ID: <GITHUB_CLIENT_ID>
GITHUB_CLIENT_SECRET: <GITHUB_CLIENT_SECRET>
HOST: monkeyci.platan.us
@blackjid
blackjid / README.md
Last active May 8, 2018 13:52
Worldcup Brazil 2014 Google Calendar Matches widget for Dashing