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 / mysql.database.yml
Created June 25, 2018 23:56 — forked from jwo/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
@juanhuttemann
juanhuttemann / Vagrantfile
Last active September 26, 2018 00:01
Ubuntu Vagrant Setup for Rails
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/trusty64'
config.vm.hostname = 'appname'
config.vm.network "private_network", ip: "192.168.10.10"
config.vm.network "forwarded_port", guest: 3000, host: 3000
config.vm.synced_folder ".", "/home/vagrant/"
@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,
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 / 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/
timedatectl set-timezone America/Asuncion
@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");
#instalar nodemon (en la máquina virtual)
sudo npm install -g nodemon
#copiar nodemon.json al directorio del proyecto
#copiar rails.sh al directorio del proyecto
#dar permisos de ejecución a rails.sh
sudo chmod +x rails.sh
#iniciar nodemon
@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 / 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