Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am avgp on github.
* I am g33konaut (https://keybase.io/g33konaut) on keybase.
* I have a public key whose fingerprint is C6C5 0090 A5BD DA3A BA52 26DA 78C5 C26F 75B1 EB5E
To claim this, I am signing this object:
@AVGP
AVGP / designer.html
Created August 27, 2014 16:21
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@AVGP
AVGP / apotd.go
Created September 25, 2014 08:29
Agile Principle of the day - simple HTTP quote service
package main
import(
"fmt"
"math/rand"
"time"
"net/http"
)
func main() {
@AVGP
AVGP / ar_heading.js
Created November 20, 2014 14:27
Handy function to get the difference between target heading and current heading
function getAngle(currentHeading, target) {
if(currentHeading > 180) {
target += 360;
}
return Math.abs(currentHeading - target);
}
@AVGP
AVGP / index.js
Created November 22, 2014 17:39
Demo of node.js SOAP client
var soap = require("soap");
soap.createClient("http://www.w3schools.com/webservices/tempconvert.asmx?WSDL", function(err, client) {
if(err) {
console.error("Can't create client", err);
return;
}
client.CelsiusToFahrenheit({Celsius: "25"}, function(err, result) {
if(err) {
console.error("Can't call method", err);
@AVGP
AVGP / app.js
Created January 21, 2015 18:31
Karma sample
// js/app.js
function add(a, b) {
return a+b;
}
function say(text) {
document.body.textContent = text;
}
@AVGP
AVGP / presentation.py
Created June 26, 2015 06:03
Python script to listen to Myo "WAVE" poses to send left/right key events under Linux
import sys
import os
sys.path.append('../lib/')
from device_listener import DeviceListener
from pose_type import PoseType
class WavePoseListener(DeviceListener):
def on_pose(self, pose):
pose_type = PoseType(pose)
@AVGP
AVGP / hg_changes.bash
Created August 10, 2015 18:58
Small bash function that outputs the number of lines added and removed in a commit
DEFAULT="[37;40m"
RED="[31;40m"
GREEN="[32;40m"
hg_changes() {
echo -e "\e${RED}`hg log -pr $1 | grep '^+' | wc -l` Additions\e${DEFAULT}"; echo -e "\e${GREEN}`hg log -pr $1 | grep '^-' | wc -l` Deletions\e${DEFAULT}";
}
[2015-09-08 14:56:17,530][WARN ][transport.netty ] [Captain Wings] exception caught on transport layer [[id: 0x93369774, /127.0.0.1:37573 :> /127.0.0.1:9300]], closing connection
java.io.StreamCorruptedException: invalid internal transport message format
@AVGP
AVGP / Liste.h
Created September 29, 2010 12:28
#include "ListenElement.h"
class Liste
{
public:
Liste()
{
head = NULL;
size = 0;
}