Skip to content

Instantly share code, notes, and snippets.

Alex Gonzalez Lacasa aloon

Block or report user

Report or block aloon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aloon /
Created Aug 30, 2014
Simple shell script to test STDIN and STDOUT
if [ -t 0 ]; then
echo nothing in STDIN
while read LINE; do
echo ${LINE}
exit 0
aloon /
Last active Feb 4, 2020
Chuleta GIT


Configuracion inicial


git config --global "Alex Gonzalez"
git config --global
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
aloon / gist:5263296
Created Mar 28, 2013
Get the additional info inserted in property through attributtes
View gist:5263296
using System;
using System.Reflection;
class moreInfoAttribute : Attribute
public string valor { get; set; }
aloon / gist:4771179
Last active Dec 12, 2015
get UniqueRandomNumbers
View gist:4771179
Private Shared Function UniqueRandomNumbers(NumAleatories As Integer, elements As Integer) As List(Of Integer)
Dim aleatorios As New List(Of Integer)
If elements > 0 Then
Dim temp As List(Of Integer) = Enumerable.Range(0, elements)
If NumAleatories > elements Then
aleatorios = temp.OrderBy(Function(a) Guid.NewGuid())
Dim r As New Random(DateTime.Now.Millisecond)
aloon / extract_fixtures.rake
Created Apr 3, 2012
extracting data for fixtures
View extract_fixtures.rake
desc "extracting data for fixtures"
task :extract_fixtures => :environment do
sql = "SELECT * FROM %s"
skip_tables = ["schema_info","schema_migrations"]
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|
i = "000"'test','fixtures',"#{table_name}.yml"), 'w' ) do |file|
data = ActiveRecord::Base.connection.select_all(sql % table_name)
file.write data.inject({}) { |hash, record|
aloon / threads.rb
Created Mar 17, 2012
download and delete all from S3
View threads.rb
#!/usr/bin/env ruby
require 'fileutils'
require 'right_aws'
BUCKET = 'jujuego'
DOWNLOAD_DIR = '../files'
BUCKET_NAME = 'jujuego'
aloon / main.rb
Created Mar 10, 2012
download and delete from S3
View main.rb
#!/usr/bin/env ruby
require 'fileutils'
require 'aws/s3'
DOWNLOAD_DIR = 'files'
cont = true
You can’t perform that action at this time.