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

Jelly Beans Terminal Color Theme

image

Terminal Colors

:

@msubel
msubel / uuid_v4_excel_formula.txt
Created July 14, 2015 12:37
An Excel Fromula to generate a UUID v4
=LOWER(CONCATENATE(DEC2HEX(RANDBETWEEN(0;POWER(16;8));8);"-";DEC2HEX(RANDBETWEEN(0;POWER(16;4));4);"-";"4";DEC2HEX(RANDBETWEEN(0;POWER(16;3));3);"-";DEC2HEX(RANDBETWEEN(8;11));DEC2HEX(RANDBETWEEN(0;POWER(16;3));3);"-";DEC2HEX(RANDBETWEEN(0;POWER(16;8));8);DEC2HEX(RANDBETWEEN(0;POWER(16;4));4)))
@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

# 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
@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;
@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"
}
@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
@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
@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;
@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. - vjt@openssl.it
--- 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