Skip to content

Instantly share code, notes, and snippets.

View javierhonduco's full-sized avatar

Javier Honduvilla Coto javierhonduco

View GitHub Profile
@javierhonduco
javierhonduco / gist:2331576
Created April 7, 2012 19:38 — forked from jonnybeadle/gist:1989179
jQuery Google CDN
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>
@javierhonduco
javierhonduco / server.py
Created September 4, 2012 15:02
Just the flask server version of wonderful @mattt's https://github.com/mattt/GroundControl/ Just add a procfile and maybe gunicorn. Enjoy! ;)
from flask import Flask
from plistlib import writePlistToString
app = Flask(__name__)
@app.route("/")
def default_plist():
plist_content = {
'Greeting' : "Hello, World",
'Price' : 4.20,
'FeatureXIsLaunched' : True
@javierhonduco
javierhonduco / sort1mb.cpp
Created October 28, 2012 22:05 — forked from preshing/sort1mb.cpp
Sort one million 8-digit numbers in 1MB RAM
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef unsigned int u32;
typedef unsigned long long u64;
//-------------------------------------------------------------------------
// WorkArea
//-------------------------------------------------------------------------
@javierhonduco
javierhonduco / capuccino_blanco.rb
Created November 11, 2012 15:07
Receta de capuccino de/con chocolate blanco (dependiendo de las proporciones)
puts "Listo para ser completado!"
@javierhonduco
javierhonduco / helpers.uri.js
Created December 14, 2012 00:35
Url serialization helpers in javascript
(function () {
uri = {}; var response = "?";
uri.serialize = function(_params){
for(var _value in _params){
response += encodeURIComponent(_value);
response += "=";
response += encodeURIComponent(_params[_value]);
response += "&";
@javierhonduco
javierhonduco / gist:4392974
Created December 27, 2012 23:03
Some webpages gathered around
http://docs.python.org/2/library/os.html
http://pypi.python.org/pypi/colorama
http://fabric.readthedocs.org/en/0.9.0/usage/env.html
http://docs.fabfile.org/en/1.5/usage/parallel.html
http://docs.python.org/2/library/curses.html
http://stackoverflow.com/questions/2122385/dynamic-terminal-printing-with-python
http://stackoverflow.com/questions/1956777/how-to-make-fabric-ignore-offline-hosts-in-the-env-hosts-list
http://awaseconfigurations.wordpress.com/2011/10/20/fun-with-fabric-first-lab-tests/
public void guardarFichaOrdenada(Ficha ficha){
/*
Se anade y luego ordena. Tiene ñacañá complejidad
que insertarlo si esta ordenado
*/
guardarFicha(ficha);
array = new Ficha[getSize()];
DNode<Ficha> current = getFirstNode();
for(int ii = 0; current != getTrailer(); current = current.getNextNode()){
array[ii] = getAt(ii);
from pqueue import PersistentQueue
q1 = PersistentQueue("/tmp/queue_storage_dir")
q1.put("1")
q1.put("2")
q1.put("3")
q1.close()
q2 = PersistentQueue("/tmp/queue_storage_dir")
while not q2.empty():
@javierhonduco
javierhonduco / estructura.rb
Last active December 25, 2015 06:39
Para los vagos. TODO * THE THINGS.
require 'digest/sha1'
dir = '/Users/javierhonduco/Dropbox/uni/Estructura/lab/CodigoInicialP1'
exercise = 'E2-CompToInt'
args = 10000001
interval = 0.5
def dirhash dir
items = []
hashs = []
class Node
attr_accessor :id, :type, :goto
def initialize(type = nil, goto = {})
@type, @goto = type, goto
end
end
def matches?(pattern, text)