Skip to content

Instantly share code, notes, and snippets.

View YerkoPalma's full-sized avatar
🙊
(Not) Working?

Yerko Palma YerkoPalma

🙊
(Not) Working?
View GitHub Profile
#!/bin/bash
bold=$(tput bold)
normal=$(tput sgr0)
# if there is not TEMPLATE folder
if [ -z "$TEMPLATES" ]; then
printf "%sbin/savior:%s TEMPLATES variable not set\n" "$bold" "$normal"
exit 1
fi
@YerkoPalma
YerkoPalma / client.js
Created October 4, 2016 14:57
Choo title example with chooify
const choo = require('choo')
const component = require('./title.choo')
const app = choo()
app.model(component.model)
app.router((route) => [
route('/', component.view)
])
# bashrc for c9 workspaces
# by Yerko Palma
. /etc/apache2/envvars
# If not running interactively, don't do anything else
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
@YerkoPalma
YerkoPalma / new.html.erb
Last active February 25, 2016 17:22
Actualización de dropdown de comunas en base a regiones en rails (sin ajax)
<%= form_for(:user, :url => {:action => 'create', :controller=>"users"}, :class => "col s12") do |f| %>
<% cities_array = @regiones.map { |city| [city[:nombre], city[:codigo]] } %>
<%= f.select( :region, options_for_select(cities_array), {}, {}) %>
<%= f.label :region %>
<%= f.select(:comuna, [], {}, {}) %>
<%= f.label :comuna %>
<button type="submit" name="action">Siguiente</button>