Skip to content

Instantly share code, notes, and snippets.

View demimismo's full-sized avatar

David Arango demimismo

View GitHub Profile
## CAUTION: Very rough draft. A more complete and polished version will follow soon:
---
Kandypot es un sistema de karma social, implementado en forma de API HTTP para su uso desde/por toda clase de sitios basados en la interacción social. Tiene tres principios básicos:
- Recompensa: a las buenas acciones se les conceden premios. Estos premios son unidades de kandies.
- Aleatoriedad: No se recompensan todas las acciones, sino que se maneja un porcentaje de probabilidad que determina que a veces se otorga el premio, a veces no.
- Transferencia: si la buena acción implica a dos usuarios, y merece premio, se produce una transferencia de kandies del recompensado al otro usuario involucrado. Es decir, si yo dejo un comentario en un post tuyo, y mi comentario me hace ganar 10 kandies, un porcentaje de estos pasarán a ti.
@littlemove
littlemove / rawclone.rb
Created November 18, 2010 15:38
Reads a file with the output from gem list and installs the gems
#! /usr/bin/ruby
# So you want to start developing an already "woking" project. No
# bundle, config.gem's not present or messing up dependencies. Fear
# not!
# Do a "gem list" wherever the project is already working
# (production?, some colleage machine?). Make a file with this format:
#
# chronic (0.2.3)
# colored (1.1)
# We have some cached pages (not every page) and we need to analyze if there's a huge concentration of misses as we have poor performance
# This simple script gets a rails log file and parses it to find the hits/misses to the cache and the response times
# key points:
# - Cache expires with time, so it's easy to parse the logs and detect misses
# The ouput is a CSV format with four columns: Minute, misses, hits and average request time
# CHANGES:
# 2010-11-30 16:11 : Extracted the regexp so we can use it for another logfiles
# 2010-11-30 16:11 : Included URL regexps so we can define which URLs shoud be analyzed and wich ones ignored
@afgomez
afgomez / colorize_git_ps1.bash
Created April 7, 2011 21:06
Color current git branch in prompt
# Color the current git branch in prompt
# red -> master branch, take care!
# blue -> just a normal branch
# green -> dev branch
# cyan -> feature branch
# magenta -> fix branch
function __colorize_git_ps1 () {
local branch=$(__git_ps1 "%s")
if [ -n "$branch" ]; then
@madrobby
madrobby / README.md
Created May 17, 2011 16:34 — forked from 140bytes/LICENSE.txt
Luhn10 algorithm

Implementation of the Luhn 10 algorithm to check validity of credit card numbers. See http://en.wikipedia.org/wiki/Luhn_algorithm for details on the algorithm.

var validCreditCard = function(a,b,c,d,e){for(d=+a[b=a.length-1],e=0;b--;)c=+a[b],d+=++e%2?2*c%10+(c>4):c;return!(d%10)};

validCreditCard('378282246310005'); //=> true
validCreditCard('378282246310006'); //=> false

// some numbers to test with
// 378282246310005 371449635398431 378734493671000
@brenes
brenes / render_json_temp.js
Created May 27, 2011 11:11
Tiny JQuery extension to render json over an element using Tempo
$(function(){
(function($) {
$.fn.render_json = function (url, data_to_send) {
$.ajax({url: url, dataType: 'json', data: data_to_send, context: $(this),
success: function(data_received){
if(data_received.length > 0)
{
$(this).each(function () {
Tempo.prepare(this.id).render(data_received);
});
@rsierra
rsierra / rawclone_bundler.rb
Last active September 28, 2015 06:38
Script para generar el Gemfile de bundler a partir de un 'gem list'
#!/usr/bin/env ruby
# So you want to start developing an already "woking" project. No
# bundle, config.gem's not present or messing up dependencies. Fear
# not!
# Do a "gem list" wherever the project is already working
# (production?, some colleage machine?). Make a file with this format:
#
# chronic (0.2.3)
# colored (1.1)
@snikch
snikch / gist:2582549
Created May 3, 2012 02:05
Prevent AssetNotPrecompiledError before it occurs.
# Checks that the precompile list contains this file or raises an error, in dev only
# Note: You will need to move config.assets.precompile to application.rb from production.rb
def javascript_include_tag *sources
sources.each do |source|
raise "Hey, #{source} is not in the precompile list. This will fall apart in production." unless Rails.application.config.assets.precompile.any? do |matcher|
if matcher.is_a? Proc
matcher.call(source)
elsif matcher.is_a? Regexp
matcher.match(source)
else
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@jaimeiniesta
jaimeiniesta / rails_jobs.txt
Last active November 15, 2018 09:15
Resources to find a job as a Rails developer
The following is a list of places where you can find job offers as a Rails developer:
https://twitter.com/currofile
https://twitter.com/domestikaempleo #spain only
http://www.workingwithrails.com/
https://weworkremotely.com/jobs/search?term=rails
https://jobs.github.com/
http://trabajosrails.com/ # spain only
http://www.indeed.com/q-Ruby-On-Rails-Developer-jobs.html