Skip to content

Instantly share code, notes, and snippets.

View juanhuttemann's full-sized avatar

Juan Hüttemann juanhuttemann

  • Asunción, Paraguay
View GitHub Profile
@juanhuttemann
juanhuttemann / secret_key.sh
Created July 10, 2017 00:40
Adds Rails Secret Key to user profile as Env Variable
#!/bin/bash
OUTPUT="$(rails secret RAILS_ENV=production)"
SECRET="SECRET_KEY_BASE=${OUTPUT}"
echo $SECRET >> ~/.profile
@juanhuttemann
juanhuttemann / deploy.sh
Last active July 10, 2017 01:44
Rails secret key, migrations, seeds and assets compile generation
#!/bin/bash
bundle install
OUTPUT="$(rails secret RAILS_ENV=production)"
SECRET="SECRET_KEY_BASE=${OUTPUT}"
echo $SECRET >> ~/.profile
rails db:migrate RAILS_ENV=production
rails db:seed RAILS_ENV=production
rails assets:precompile RAILS_ENV=production
@juanhuttemann
juanhuttemann / Vagrantfile
Created July 10, 2017 04:22
Vagrantfile for Rails 5.0.3 on Ubuntu Trusty x64 + Nginx + Phusion Passenger
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 3000, host: 3002
config.vm.network "forwarded_port", guest: 3306, host: 3004
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder ".", "/home/vagrant/apps"
@juanhuttemann
juanhuttemann / inflections.rb
Created October 5, 2017 13:38
Inflections (Español)
# config/inflections.rb
# Ruby on Rails inflections
#
# Common inflections for Spanish MX (es-MX).
# Flexiones más comunes para español México.
#
ActiveSupport::Inflector.inflections(:"es-MX") do |inflect|
############# Reglas generales
@juanhuttemann
juanhuttemann / Instrucciones.txt
Last active October 9, 2017 01:00
browser-sync rails
#instalar browser-sync
npm install -g browser-sync
#iniciar browser-sync
browser-sync start --proxy 192.168.33.10:3000 --files "app/assets/stylesheets/**/*.scss, app/views/**/*.html.erb"
@juanhuttemann
juanhuttemann / users.js
Last active October 31, 2017 22:23
Filterby + Input + RegEx Emberjs
import Controller from '@ember/controller';
import { isBlank } from "@ember/utils";
export default Controller.extend({
searchKeyword: "",
updateList: Ember.computed('searchKeyword', function(){
var keyword = this.get('searchKeyword')
var regex = new RegExp(keyword, "gi");
timedatectl set-timezone America/Asuncion
FROM ruby:2.3.3
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /myapp
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
EXPOSE 3000
VOLUME /myapp
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
@juanhuttemann
juanhuttemann / config vscode
Last active June 8, 2018 12:19
VSCode Custom Config
{
"workbench.colorTheme": "One Dark Pro",
"editor.fontSize": 16,
"editor.fontFamily": "'Source Code Pro', Consolas, 'Courier New', monospace",
"workbench.statusBar.visible": true,
"explorer.openEditors.visible": 0,
"workbench.iconTheme": "eq-material-theme-icons",
"window.menuBarVisibility": "toggle",
"editor.renderControlCharacters": true,
"workbench.activityBar.visible": true,
@juanhuttemann
juanhuttemann / gist:10fec7360619c1884e875f0d992eaa8e
Last active June 22, 2018 17:00
Install Free TDS for tiny_tds gem Ubuntu
wget https://sources.voidlinux.eu/freetds-1.00.23/freetds-1.00.23.tar.gz
or https://distfiles.macports.org/freetds/freetds-1.00.23.tar.bz2
tar -zxvf freetds-1.00.23.tar.gz
or tar -jxvf
Then
cd freetds-1.00.23/