Skip to content

Instantly share code, notes, and snippets.

View matiasinsaurralde's full-sized avatar

Matias Insaurralde matiasinsaurralde

  • Paraguay
View GitHub Profile
@matiasinsaurralde
matiasinsaurralde / mw.js
Created September 27, 2017 12:01
mw.js
const grpc = require('grpc'),
resolve = require('path').resolve
const tyk = grpc.load({
file: 'coprocess_object.proto',
root: resolve(__dirname, 'tyk-protobuf/proto')
}).coprocess
const listenAddr = '127.0.0.1:5555',
authHeader = 'Authorization'
@matiasinsaurralde
matiasinsaurralde / Program.cs
Created September 8, 2017 05:38
Program.cs
using System;
using Grpc.Core;
namespace tyk_plugin
{
class Program
{
// Port to attach the gRPC server to:
const int Port = 5555;
@matiasinsaurralde
matiasinsaurralde / Server.cs
Created September 8, 2017 05:37
Server.cs
using System;
using System.Threading.Tasks;
using Grpc.Core;
using Coprocess;
class DispatcherImpl : Dispatcher.DispatcherBase
{
public DispatcherImpl()
{
@matiasinsaurralde
matiasinsaurralde / bebop-test.go
Created September 1, 2017 12:30
bebop-test.go
package main
import (
"time"
"gobot.io/x/gobot/platforms/parrot/bebop/client"
)
func main() {
bebop := client.New()
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsR3in+84KcH/GHAksqczRE5S+wDgB8qB+SJxvzWw3qjwPSohvuR4WXdQ8UCqjWq/6uGYq79EHlzlKE9P6lJbhEgf9FRwv8k8MSqDjhoQ5QZeXaEE750+PZLK/pb2MkriNXIGxg6ul8V+F0o4XnkVLbefMhQDzLDVgyg0dFwp6TGVqpufmD6gvvwnQD5BHSFMQT3MSq6o/wQj3hc/yhHlhwJ4+6iC7bdBv426fGdCs+nbi2BjXHzLEf7bLks5vOTJexGTHdfPlb5JOBTTfzZ0Kw0BMBjTnJpnRcyGOvQJ/K/a7ye/xusG/ZyDh/NsghPX2BjFPfbN3rW5hzvr3PZhn
@matiasinsaurralde
matiasinsaurralde / pupil.py
Created May 27, 2017 04:23 — forked from edfungus/pupil.py
Pupil Detection with Python and OpenCV
#Identify pupils. Based on beta 1
import numpy as np
import cv2
import time
cap = cv2.VideoCapture(0) #640,480
w = 640
h = 480
[ {
"title": "Token Session Object Details - Tyk Documentation ",
"article": "\n Edit on GitHub\n \n Token Session Object Details\n All tokens that are used to access services via Tyk correspond to a session object that informs Tyk about the context of this particular token.\n\nA session object takes the following form:\n\n {\n \"last_check\": 0,\n \"allowance\": 1000,\n \"rate\": 1000,\n \"per\": 1,\n \"expires\": 1458669677,\n \"quota_max\": 1000,\n \"quota_renews\": 1458667309,\n \"quota_remaining\": 1000,\n \"quota_renewal_rate\": 3600,\n \"access_rights\": {\n \"e1d21f942ec746ed416ab97fe1bf07e8\": {\n \"api_name\": \"Closed\",\n \"api_id\": \"e1d21f942ec746ed416ab97fe1bf07e8\",\n \"versions\": [\"Default\"],\n \"allowed_urls\": null\n }\n },\n \"org_id\": \"53ac07777cbb8c2d53000002\",\n \"oa
package crawl
import (
"net/http"
"testing"
)
type testHandler struct {
}
package connector_test
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"testing"
"time"
@matiasinsaurralde
matiasinsaurralde / problem.cpp
Created April 2, 2017 10:07 — forked from depp/problem.cpp
A Faster Solution
// Faster solution for:
// http://www.boyter.org/2017/03/golang-solution-faster-equivalent-java-solution/
// With threading.
// g++ -std=c++11 -Wall -Wextra -O3 -pthread
// On my computer (i5-6600K 3.50 GHz 4 cores), takes about ~160 ms after the CPU
// has warmed up, or ~80 ms if the CPU is cold (due to Turbo Boost).
// How it works: Start by generating a list of losing states -- states where the
// game can end in one turn. Generate a new list of states by running the game