Skip to content

Instantly share code, notes, and snippets.

View angelbotto's full-sized avatar
🏃

Angel Celis Botto angelbotto

🏃
View GitHub Profile
@angelbotto
angelbotto / about.liquid
Last active December 30, 2015 18:29
Zoomy theme for landmoda newbies model's
<br>
<div class="content">
<div class="container">
<div class="about">
<div class="row">
<div class="span6">
<div class="about_image">
<img src="http://s3.landmoda.com/multimedia/{{ model.identificator }}/book/{{ book.multimedias.first.name }}" alt="">
</div>
</div>
@angelbotto
angelbotto / about.liquid
Created December 9, 2013 04:32
Getsimple minimalist theme for newbiews model's
<div id="bio">
<p><strong>{{ model.name }}</strong></p>
<br>
<div class="content">
{{ model.aboutme }}
</div>
</div>
@angelbotto
angelbotto / vid2gif.pl
Created December 2, 2013 05:49
Create gif from video .... #newproject
#!/usr/bin/perl
# Quick script to convert a video file to a GIF based on time indicators.
# Inspired by the ugly Bash script at http://www.davidgouveia.net/2011/09/how-to-convert-video-to-animated-gifs-from-a-linux-console/
# See `vid2gif --help` for more info.
use strict;
use warnings;
use diagnostics; # useful for debugging;
use feature 'say'; # beats print;
use Getopt::Long; # for parsing command-line options;
use File::Temp; # for tempdirs to store scratch files;
@angelbotto
angelbotto / date_range.rb
Created December 1, 2013 22:37
Perfect for create charts..
date = Time.now
start_date = Time.new(date.year, date.month, 1)
end_date = start_date + 1.month
# We generate a basic project
say
dev = yes?("Are you using padrino-dev?").present?
tiny = yes?("Do you need a tiny structure?").present?
adapter = ask("SQL adapter for ActiveRecord (sqlite, mysql, postgres, none):")
project :test => :none, :renderer => :haml, :script => :jquery, :orm => :activerecord, :dev => dev, :tiny => tiny, :adapter => adapter
say "=> Installing exception notifier", :magenta
execute_runner :plugin, :exception_notifier
@angelbotto
angelbotto / Gemfile
Created September 15, 2013 08:28
Phusion passenger in heroku
gem 'passenger', '>= 4.0.16'
@angelbotto
angelbotto / Gemfile
Created July 31, 2013 09:55
keepalive in padrino and heroku easy xd
source 'http://rubygems.org'
ruby "1.9.3"
gem 'httparty'
gem 'clockwork'
gem 'foreman'
@angelbotto
angelbotto / Gemfile
Last active December 20, 2015 01:49
Unicorn en Heroku
#agregar
gem 'unicorn'
#################################################################
#
# File: lib/api.rb
#
#################################################################
require 'user' # ActiveRecord model
# Connect to the db
ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'])
@angelbotto
angelbotto / perfectUsername.rb
Last active December 10, 2015 14:49
Creando el username perfecto, un pequeño metodo que ayuda a remplazar y eliminar caracteres extraños para crear un username perfecto :) :s si tiene ideas de como poder mejorarlo agradeceria enormemente :)
def perfectUsername(string)
string = string.tr(' ','-')
string = string.tr('áàäâªÁÀÂÄéèëêÉÈÊËíìïîÍÌÏÎóòöôÓÒÖÔ','aaaaaAAAAeeeeEEEEiiiiIIIIooooOOOOúùüûÚÙÛÜuuuuUUUUñÑçÇnNcC')
string = string.gsub(/[^0-9A-Za-z]/, '')
end