Skip to content

Instantly share code, notes, and snippets.


Javier Honduvilla Coto javierhonduco

View GitHub Profile
javierhonduco /
Created Apr 6, 2022 — forked from csfrancis/
Dump an MRI call stack from gdb
# Updated for Ruby 2.3
string_t = None
def get_rstring(addr):
s = addr.cast(string_t.pointer())
if s['basic']['flags'] & (1 << 13):
return s['as']['heap']['ptr'].string()
return s['as']['ary'].string()
View java_helloworld_gdb.txt
[javierhonduco@ ~/experiments] cat
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
[javierhonduco@ ~/experiments] javac
[javierhonduco@ ~/experiments] gdb --args java HelloWorld
javierhonduco / server_timing_middleware.rb
Last active Apr 4, 2017
Small rack server timing middleware
View server_timing_middleware.rb
# This simple Rack middleware subscribes to all AS::Notifications
# and adds the appropriate `Server-Timing` header as described in
# the spec [1] with the notifications grouped by name and with the
# elapsed time added up.
# [1] Server Timing spec:
module Rack
class ServerTimingMiddleware
def initialize(app)
import requests
import json
from bs4 import BeautifulSoup
config = {
'login_url': '',
'user': '',
'password': ''
javierhonduco / Gemfile
Last active Oct 16, 2016
View Gemfile
source ''
gem 'rails', '5.0.0'
gem 'sqlite3'
gem 'http_accept_language'
gem 'friendly_id', '~> 5.0.0'
gem 'acts-as-taggable-on'
gem 'activeadmin', github: 'activeadmin'
javierhonduco /
Last active Jul 6, 2021
Stupid guide on how to install FuzzyCLIPS on OSX and Linux

In order to install FuzzyCLIPS on OSX and Linux you simply have to

  • Clone the repo
$ git clone && cd FuzzyCLIPS/source
  • Compile it
$ make fzclips
  • Use the binary! 🎉
javierhonduco /
Created Mar 30, 2016
GCD computing without modulo neither division ops
# computes the greatest common divisor
# with a small subset of math operations
# that does not include `division` or `modulo`
def gcd(a, b):
while b>0:
c = a
a = b
while(c >= b):
c -= b
b = c
View Songs that Anna has listened and I have not :(
Dota - Basshunter
Winston Churchill's Boy - Benjamin Clementine
El Mal - Los Punsetes
Life Less Frightening - Rise Against
For The Strangers - Suede
Suburban Home - Descendents
Life Eternal - Mayhem
Christmas (Baby Please Come Home) - Mariah Carey
Pistol (A. Cunanan, Miami, FL. 1996) - Modest Mouse
She’s In Fashion (Remastered) - Suede
javierhonduco /
Last active Aug 29, 2015 — forked from alexissmirnov/
Django QueryParameterLocaleMiddleware
from django.middleware import locale
from django.utils import translation
class QueryParameterLocaleMiddleware(locale.LocaleMiddleware):
Django's LocaleMiddleware picks the locale setting of the request from
multiple sources such as a cookie, Accept-Language header and server-side
This middleware adds one more way to specify the language by supplying
import gc
from celery.signals import task_postrun
def gc_on_task_postrun(**kwargs):