Skip to content

Instantly share code, notes, and snippets.

View raliste's full-sized avatar

Rodrigo Aliste raliste

View GitHub Profile
declare module 'twilio-video' {
// this actually returns a CancelablePromise
export function connect(token: string, options: ConnectOptions): Promise<Room>;
export function createLocalTracks(options?: CreateLocalTracksOptions): Promise<LocalTrack[]>;
export interface ConnectOptions {
name: string;
tracks: (LocalTrack | MediaStreamTrack)[];
}
// esto lo podrias hacer en el archivo de file retrieval
var storage = require('./utils/storage');
var files_path = join(common.system.paths.config, 'files.db');
storage.init(files_path);
var una_funcion = function(cb) {
// Guardar un dato
storage.set('nombre_del_archivo', {ultimo_byte: 321321, otra_info: "hola"}, cb);
d := Response{
XMLName: xml.Name{
Local: "samlp:Response",
},
SAML: "urn:oasis:names:tc:SAML:2.0:assertion",
SAMLP: "urn:oasis:names:tc:SAML:2.0:protocol",
ID: ar.Id,
Version: "2.0",
IssueInstant: ar.IssueInstant,
Destination: "https://www.google.com/a/preyproject.com/acs",
@raliste
raliste / map.go
Last active August 29, 2015 14:03
Ejercicio 1
package main
import (
"log"
"reflect"
)
// Implements map by closure
type Mapper func(interface{}) interface{}
@raliste
raliste / test.py
Created October 13, 2013 01:50
Super easy and scalable async queues with Python and Golang. And see nice stats by doing `gem install resque` and then `resque-web`. You might need to add your goworker queue into redis to make it show up in resque-web.
import redis
RESQUE_QUEUE = 'resque:queue:%s'
def test(n=0):
r = redis.Redis()
r.rpush(RESQUE_QUEUE % 'notifications', '{"class":"EmailNotification","args":["hi","there %s"]}' % n)
if __name__ == '__main__':
for i in xrange(100):
@raliste
raliste / yinyang.html
Last active December 23, 2015 02:09
Yin Yang for StarTechConf 2013
<!DOCTYPE html>
<html>
<head>
<style>
/*
Author: Rodrigo Aliste-Prieto (raliste@gmail.com)
Version: 1
Date: 14 September 2013
Tested on: Chrome, Safari and Firefox.
*/
@raliste
raliste / server.go
Created July 20, 2013 04:52
Simple reporting server in Go
package main
import (
"log"
"flag"
"fmt"
"database/sql"
_ "github.com/go-sql-driver/mysql"
)
@raliste
raliste / gosearch.go
Last active December 18, 2015 19:49
Gosearch
/*
Python Client
import socket
import json
s.sendall(json.dumps({"method":"Search.Search", "params":[{"UserQuery":"providencia 229"}], "id":uuid.uuid4().hex})); print s.recv(1024)
*/
package main
import (
<?xml version="1.0" encoding="UTF-8"?><Response><Say lang="es">El codigo es 239212</Say></Response>
@raliste
raliste / gist:4091897
Created November 16, 2012 23:31
Joldit's Webpay Plus (Django)
## views.py
import tempfile
import os
import commands
import cgi
from django import http
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render