Skip to content

Instantly share code, notes, and snippets.

View carlossanchezp's full-sized avatar

Carlos Sánchez Pérez carlossanchezp

View GitHub Profile
@shernade
shernade / Parser.rb
Last active December 25, 2015 02:39
This class parse a hash of params looking for a date field and parse its value to timestamp
class Parser
def initialize(hash)
@hash = hash
end
def parse()
@hash.inject({}) do |h, (k, v)|
h[k] = parse_element(k, v)
h
end
@eLafo
eLafo / svn2git
Last active December 24, 2015 15:49
#!/bin/bash
echo "Creating tags"
for tag in `git branch -r | grep "tags/" | egrep -vw "svn/tags/(integration|production)" | sed 's/ tags\///'`; do
git_tag_name=`echo "$tag" | sed 's/tags\///'`
parents=`git show --format="%P" refs/remotes/$tag`
real_parent=`echo "$parents" | cut -d' ' -f 2`
git tag -a -m"Converting SVN tags" $git_tag_name $real_parent
done
@eLafo
eLafo / install.txt
Last active July 5, 2021 14:25
My install notes for ubuntu. Must be reviewed, but in the meanwhile... it's ok for me
# Update System
# ------------------------------------------------------------------------------
echo 'Updating System...'
sudo apt-get -y update
# Hardware
# ------------------------------------------------------------------------------
echo 'Installing bumblebee'
sudo add-apt-repository -y ppa:bumblebee/stable && sudo apt-get update
sudo apt-get -y install bumblebee bumblebee-nvidia
@josevalim
josevalim / 0_README.md
Created September 13, 2012 21:52
Sinatra like routes in Rails controllers

Sinatra like routes in Rails controllers

A proof of concept of having Sinatra like routes inside your controllers.

How to use

Since the router is gone, feel free to remove config/routes.rb. Then add the file below to lib/action_controller/inline_routes.rb inside your app.