Skip to content

Instantly share code, notes, and snippets.

@blackjid
blackjid / Readme.md
Last active Aug 5, 2020
Rails abort if pending migrations with data
View Readme.md

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
View code_review_and_prs.md

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
View price_load.rb
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 Jan 4, 2017
Update heroku multibuildpack on all your apps
View update-multi.sh
#!/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 Sep 9, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View keybase.md

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 Oct 6, 2015
Rootless Ams Style for Restmod
View noroot-ams.js
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'
},
View hound.production.yml
app:
image: platanus/hound
ports:
- 3000
volumes:
- /usr/src/app
links:
- db
- redis
env_file: .env.production
@blackjid
blackjid / docker-compose.yml
Last active Aug 29, 2015
Hound with Docker and Rancher
View docker-compose.yml
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
Worldcup Brazil 2014 Google Calendar Matches widget for Dashing
View README.md