Skip to content

Instantly share code, notes, and snippets.

View pablox-cl's full-sized avatar

Pablo Olmos de Aguilera Corradini pablox-cl

View GitHub Profile
@juque
juque / MySQL-Chile:regiones-provincias-comunas
Created July 6, 2010 19:32
Chile: Regiones, Provincias, Comunas
/* Estructura y Datos de las Regiones, Provincias */
/* y Comunas de Chile. */
/* */
/* Fecha: Julio 2010 */
/* Autor: Juan Pablo Aqueveque - juque.cl */
--
-- Comunas
--
DROP TABLE IF EXISTS `comunas`;
@pablox-cl
pablox-cl / instants_cl_mp3_downloader.sh
Created November 8, 2010 00:57
Bash script to download sounds from instants.cl
#!/usr/bin/env bash
#
###############################################################################
# #
# (c) 2010, Pablo Olmos de Aguilera <pablo[at}glatelier.org>; #
# Based on work from Gonzalo Diaz <me{at)gon.cl>; #
# http://gon.pastebin.com/zanh8uAq #
# #
# Based on InstantsFunGet from Felipe Astroza <felipe(at]astroza.cl> #
# http://felipe.astroza.cl/news/2010/05/08/audios-de-instantsfun-es-en-mp3/ #
@vjt
vjt / less-to-css-with-braces-on-their-own-line.diff
Created March 20, 2011 10:46
Applies to sass-3.1.0.alpha.221. Make the closing curly braces stand on their own line. - [email protected]
--- lib/sass/tree/visitors/convert.rb.orig 2011-03-20 05:32:23.000000000 +0100
+++ lib/sass/tree/visitors/convert.rb 2011-03-14 14:57:45.000000000 +0100
@@ -21,7 +21,7 @@
def visit_children(parent)
@tabs += 1
return @format == :sass ? "\n" : " {}\n" if parent.children.empty?
- (@format == :sass ? "\n" : " {\n") + super.join.rstrip + (@format == :sass ? "\n" : " }\n")
+ (@format == :sass ? "\n" : " {\n") + super.join.rstrip + (@format == :sass ? "\n" : "\n#{' '*((@tabs-1)*2)}}\n")
ensure
@tabs -= 1
@elivz
elivz / wordpress-w3tc-site.conf
Created March 20, 2011 18:06
Nginx configuration for WordPress with W3 Total Cache plugin. See http://elivz.com/blog/single/wordpress_with_w3tc_on_nginx/
server {
# Redirect yoursite.com to www.yoursite.com
server_name yoursite.com;
rewrite ^(.*) http://www.yoursite.com$1 permanent;
}
server {
# Tell nginx to handle requests for the www.yoursite.com domain
server_name www.yoursite.com;
@jhjguxin
jhjguxin / creating-nested-resources-in-ruby-on-rails-3-and-updating-scaffolding-links-and-redirection.markdown
Created July 9, 2012 03:32
Creating nested resources in ruby on rails 3 and updating scaffolding links and redirection
@stormsilver
stormsilver / unbundled_require.rb
Created October 15, 2012 19:59 — forked from zaius/unbundled_require.rb
Allow requiring of global gems from outside of the Gemfile
# Include this in your .irbrc
def unbundled_require(gem, options = {})
if defined?(::Bundler)
spec_path = Dir.glob("#{Gem.dir}/specifications/#{gem}-*.gemspec").last
if spec_path.nil?
warn "Couldn't find #{gem}"
return
end
spec = Gem::Specification.load spec_path
@benizi
benizi / simpler
Created November 30, 2012 05:26 — forked from justinabrahms/colortest.py
Show how different terminals show bold colors
#!/bin/sh
# Print four lines showing blocks of colors: 0-7 | 0-7bold | 8-15 | 8-15bold
perl -CADS -lwe '
my $block = shift || (chr(0x2588) x 3);
for (["", 0], ["1;", 0], ["", 8], ["1;", 8]) {
my ($bold, $offset) = @$_;
my @range = map $offset + $_, 0..7;
printf "%s %-6s ", $bold ? "bold" : "norm", "$range[0]-$range[-1]";
print map("\e[${bold}38;5;${_}m$block", @range), "\e[0m"
}
@hemanth
hemanth / nginx.conf
Created July 3, 2013 14:28
nginx redirections
rewrite ^/@$ https://twitter.com/:you permanent;
rewrite ^/~$ https://github.com/:you permanent;
rewrite ^/+$ https://plus.google.com/:you permanent;
rewrite ^/f$ https://www.facebook.com/:you permanent;
rewrite ^/in$ https://linkedin.com/in/:you permanent;
# sets the proxy cache path location, max size 2g
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=STATIC:100m inactive=24h max_size=2g;
# transfers the `Host` header to the backend
proxy_set_header Host $host;
# uses the defined STATIC cache zone
proxy_cache STATIC;
# cache 200 10 minutes, 404 1 minute, others status codes not cached
@chunlea
chunlea / input-group-in-simple-form.md
Last active October 5, 2021 20:03
How to use Boostrap 3 input-group in Simple Form

Finally, Simple Form support Boostrap 3. 👏

But I found it still dosen't support some components in Bootstrap 3. Or may be in the future. But I can't wait, so I find a solution to support them. It was inspired by heartcombo/simple_form#531 (comment) .

This is a final solution and I used in my project.

simple_form