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 June 11, 2023 15:15
How configure your raspberry pi with dashing to have a awesome dashboard

Raspberry pi dashboard

This is what we did to setup a few dashboards at platanus

You'll need

  • Raspberry Pi
  • Dashing Service
  • Wifi stick (optional)
@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
@blackjid
blackjid / README.md
Last active May 8, 2018 13:52
Worldcup Brazil 2014 Google Calendar Matches widget for Dashing

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
@blackjid
blackjid / gulpfile.js
Created April 9, 2014 17:59
Gulp Ionic Server + Livereload + Proxy
var gulp = require('gulp');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var connect = require('gulp-connect');
var paths = {
css: ['./www/css/**/*.css'],
js: ['./www/js/**/*.js'],
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name=$inputline
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url=$inputline
# pushState friendly!
# The setup:
# * website name is `site.com`
# * the API for your running on localhost:3000
# * the root for API calls is at `/api`, and you have authentication routes with root `/auth` (both go to localhost:3000)
# * javascript app is located at `/path/to/javascript/app`
# Assuming you have your server for API calls at localhost port 3000
upstream api_sitecom {
server localhost:3000;