Skip to content

Instantly share code, notes, and snippets.

View sergiocampama's full-sized avatar
🇨🇱

Sergio Campamá sergiocampama

🇨🇱
View GitHub Profile
@sergiocampama
sergiocampama / gist:3922453
Created October 20, 2012 07:10 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@sergiocampama
sergiocampama / jquery.mstch_tmpl.js
Created September 5, 2012 19:53
jQuery Mustache Templating Function
(function( $ ){
$.fn.mstch_tmpl = function(template, object) {
var that = this;
var template_string;
//Check if template is a string or a jQuert object
if (typeof(template)=='string' && isNaN(template)) {
template_string = template;
} else if (template instanceof jQuery){
template_string = template.html();
@sergiocampama
sergiocampama / benchmark.c
Created March 12, 2012 02:00
Benchmark for measuring a computer performance written in C. Based in matrix inversion algorithms from 'Recipes in C', with number of retries and matrix size configurables.
//Sergio Campamá 11-3-2012
//sergiocampama@gmail.com
//Numerical functions taken from the book 'Recipes in C'
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
@sergiocampama
sergiocampama / tcp_server.rb
Created February 20, 2012 19:55
Ruby TCP Server
require 'socket'
server = TCPServer.open(3010) # Socket to listen on port
loop do # Servers run forever
Thread.start(server.accept) do |client|
puts "client connected"
#do stuff
end
end
@sergiocampama
sergiocampama / mobile-meta-links.html
Created December 3, 2011 21:02
iOS Web App Configuration