Skip to content

Instantly share code, notes, and snippets.

<feedburner:info uri="aspgems" />
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license><image><link>http://planeta.aspgems.com</link><url>http://en.gravatar.com/userimage/446745/7078dc0a55bf7e17775dc347c9b70b42.png</url><title>aspgems</title></image><item>
<title>Javier Lafora :: ¿Y por qué no...?</title>
<description>&lt;img src="http://feeds.feedburner.com/~r/aspgems/~4/sZQBo_wc5no" height="1" width="1"/&gt;</description>
<pubDate>Tue, 22 Oct 2013 17:30:17 +0000</pubDate>
<link>http://feedproxy.google.com/~r/aspgems/~3/sZQBo_wc5no/y-por-que-no.html</link>
<guid isPermaLink="false">http://elafosobrerailes.blogspot.com/2013/10/y-por-que-no.html</guid>
@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
module SamyRoad
module Redis
module Objects
extend ActiveSupport::Concern
included do
include ::Redis::Objects
end
module ClassMethods
@eLafo
eLafo / example.rb
Last active December 11, 2015 05:58
class Location
include SamyRoad::Redis::Objects
has_counter: :24_hours
end
# You can access to the counter's value directly like
# location.24_hours_count
module SamyRoad
module FeedsEntryStatus
extend ActiveSupport::Concern
STATES = {
ignored: 1,
pending: 0,
published: 2,
erased: 3
}
public class Court{
private boolean[7*15] timeTable;
public Court(){
java.util.Arrays.fill(this.timeTable,true);
}
public boolean available(DateTime d, int duration){
if !validDateTime(d) || !validDateTime(d + duration){
@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
@eLafo
eLafo / invoices.yml
Created January 25, 2012 20:38
YAML file for invoices help page
en:
help:
invoices:
add_payments:
content_html: >
<p>
The following page shows how to make a payment for an invoice using %{brand_name}. Foremost, you need to <a href="/login">sign in the application</a>. Once logged, click the 'INVOICES' button
of the header menu to access your invoice's list. You can access the payment box of any invoice by clicking its pending amount link, as shown below.
</p>
<p>
@eLafo
eLafo / sphinx_post_3.rb
Created January 12, 2012 16:28
Gist #3 for a post in my blog
Hospital.search(search_query, {:order => 'emergency_service_today DESC'})