Skip to content

Instantly share code, notes, and snippets.

@xaiki
xaiki / dragaction.py
Created October 11, 2012 00:51
simple clutter drag_action test
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gi.repository import Clutter
def drag_begin_cb (action, actor, event_x, event_y, modifiers, arg = None):
print "DRAG START\t", event_x, event_y, arg
if arg:
action.set_drag_handle (arg)
def drag_end_cb (action, actor, event_x, event_y, modifiers):
@xaiki
xaiki / README.md
Last active May 8, 2018 14:54 — forked from scttnlsn/README.md

Pub/sub with MongoDB and Node.js

Setup:

$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
@xaiki
xaiki / horarios.js
Created February 12, 2013 23:44
trenes para todos
this.Horarios = {};
var trenesObj = {
estaciones: '',
proximoMoreno: function (e) { return estaciones[e][0]; },
siguienteMoreno: function (e) { return estaciones[e][1]; },
proximoOnce: function(e) { return estaciones[e][3];},
siguienteOnce: function(e) { return estaciones[e][4];}
}
@xaiki
xaiki / magicmagic.pl
Created October 22, 2013 01:19
magical do-nice things with melt
#! perl -w
use strict;
use Getopt::Long qw(:config no_ignore_case);
use Data::Dumper;
my @cmds;
my $basedir = $ENV{'PWD'};
my $out=120;
@xaiki
xaiki / README.org
Created May 1, 2014 14:05
hacks to produce libffmpegsumo.so

building ffmpegsumo is a PITA, you need to fight with chromium’s build system, but so far this seems to work:

GYP_DEFINES=”proprietary_codecs=1 target_arch=x64 branding=Chrome” ./build/gyp_chromium build/all.gyp

–> use the hacks to produce the ffmpegsumo and ffmpeg_yasm ninja files <–

./depot_tools/ninja -v -j4 -C out/Release ffmpegsumo

Simple parse script to exctract json data from bacua, used to enrich @facundobatista’s conectate code.

@xaiki
xaiki / README.org
Last active August 29, 2015 14:03
octopress blogging using org-mode
@xaiki
xaiki / zorro.pl
Created July 15, 2014 06:17
archie imdb id
#! perl -w
use strict;
my ($login, $password);
open (my $FH, 'gpg -q --use-agent --no-tty -d ~/.authinfo.gpg |');
while (<$FH>) {
m/machine\s+archive.org/ or next;
m/login\s+(\S+)/ and do { $login = $1;};
m/password\s+(\S+)/ and do { $password = $1;};
@xaiki
xaiki / archive.js
Created July 15, 2014 06:23
archive.org provider for (the DMCA boohoo) Popcorn Time
(function(App) {
'use strict';
var querystring = require('querystring');
var request = require('request');
var Q = require('q');
var Archive = function() {};
var baseURL = 'https://archive.org/';
var URL = baseURL + 'advancedsearch.php';
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cherry Clips</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"
type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"
type="text/javascript"></script>