Skip to content

Instantly share code, notes, and snippets.

View ptigas's full-sized avatar
🐙

Panagiotis Tigas ptigas

🐙
View GitHub Profile
@ptigas
ptigas / boostformat.patch
Last active March 7, 2017 11:52
patch boost/format
diff --git a/gazebo/rendering/Camera.cc b/gazebo/rendering/Camera.cc
index 09a2430..b806a87 100644
--- a/gazebo/rendering/Camera.cc
+++ b/gazebo/rendering/Camera.cc
@@ -22,7 +22,7 @@
#endif
#include <sstream>
-
+#include <boost/format.hpp>
@ptigas
ptigas / workshop_car.ino
Created February 16, 2017 11:07
workshop car
// connect the distance sensor
#define trigPin 13
#define echoPin 12
// connect motor controller pins to Arduino digital pins
// motor one
int enA = 3;
int in1 = 4;
int in2 = 5;
@ptigas
ptigas / names.json
Last active December 28, 2016 12:38
names.json
{"Andreas": "male", "Arely": "female", "Mortimer": "male", "Pauletta": "female", "Zita": "female", "Casen": "male", "Araceli": "female", "Ronald": "female", "Eura": "female", "Aracely": "female", "Destany": "female", "Cael": "male", "Kaleigh": "female", "Ayleen": "female", "Nikhil": "male", "Elex": "male", "Myah": "female", "Channie": "female", "Evalyn": "female", "Less": "male", "Jerel": "male", "Sandi": "female", "Lesa": "female", "Paul": "male", "Sandy": "female", "Kraig": "male", "Merlin": "male", "Vanesa": "female", "Matthew": "female", "Althea": "female", "Lucille": "female", "Samatha": "female", "Hamilton": "male", "Johnie": "female", "Dionne": "female", "Stephania": "female", "Stephanie": "male", "Raheem": "male", "Murl": "female", "Lafe": "male", "Ginger": "female", "Audy": "male", "Hughie": "male", "Jewell": "female", "Edra": "female", "Tatyanna": "female", "Quincy": "male", "Harvey": "male", "Agustus": "male", "Basil": "male", "Casey": "male", "Kaydence": "female", "Leilani": "female", "Dejuan": "m
@ptigas
ptigas / latex_escape.py
Created August 31, 2012 12:44
latex escape
# -*- encoding: utf-8 -*-
def latex_decode( s ) :
'''
A simple function which taks a latex escaping command
and returns the appropriate unicode character according
to this table (via wikipedia):
LaTeX command Sample Description
\`{o} ò grave accent
@ptigas
ptigas / gist:1444735
Created December 7, 2011 21:25
MapReduce example in python
'''
Playing with MapReduce in python
ref.
http://mikecvet.wordpress.com/2010/07/02/parallel-mapreduce-in-python/
'''
from multiprocessing import Pool
def generate_data(A = 90000, B = 20) :
return [ [ [j] for j in range(B)] for i in range(A)]
@ptigas
ptigas / antiDDOS.sh
Last active March 31, 2016 21:06
mitigate linode DDOS
#!/bin/bash
function join { local IFS="$1"; shift; echo "$*"; }
IFS=$'\n'
LIMIT=20
STATS=$(netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n | grep -v Address | grep -v servers)
BLACKLISTED=""
BLACKLISTED_IPS=()
EMAIL="ptigas@gmail.com"
@ptigas
ptigas / message.html
Created January 28, 2013 20:37
the message behind the voice
<html>
<head>
</head>
<body>
</body>
</html>
@ptigas
ptigas / gist:4155731
Created November 27, 2012 17:32
unifying python api response
import json
class API :
ERROR = -1
OK = 0
class APIResponse(API) :
def __init__(self, code, data) :
self.code = code
self.data = data
@ptigas
ptigas / gist:4052387
Created November 10, 2012 20:30
bootstrap django
Django==1.4
South==0.7.6
django-dbsettings==0.2
django-grappelli==2.3.8
pyechonest==4.2.21
simplejson==2.6.0
@ptigas
ptigas / latency.txt
Created May 31, 2012 13:14 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns