Skip to content

Instantly share code, notes, and snippets.

View gasp's full-sized avatar
🔧
hacking stuff

Gaspard Beernaert gasp

🔧
hacking stuff
View GitHub Profile
@gasp
gasp / query.osm
Created August 23, 2014 11:02
OSM query for operator=RAPT, is this a singularity ?
<!--
RATP or RAPT ?
-->
<osm-script output="json" timeout="25">
<!-- gather results -->
<union>
<!-- query part for: “operator=rapt” -->
<query type="node">
<has-kv k="operator" v="RAPT"/>
<bbox-query s="48.8326901185081" w="2.325925827026367" n="48.86477122456225" e="2.379741668701172"/>
@gasp
gasp / slow.js
Created December 31, 2014 09:47
randomly slow server - dev purpose only
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8976,
throttle = 2000; // ms
http.createServer(function(request, response) {
@gasp
gasp / collection.js
Created August 18, 2015 15:22
a prototype-less way to do object with javascript
var Collection = function () {
return {
db: [],
add: function (o) {
if (typeof(o.uid) === 'undefined') {
throw 'error: object has no uid';
}
if (this.get(o.uid) === false) {
this.db.push(o);
}
#include<stdio.h>
main()
{
printf("Hello World");
}
@gasp
gasp / split.js
Created July 19, 2012 18:09
run it with nodejs
//
// split.js
// parse large files by new lines.
// uses buffer for very long lines
//
// Created by gaspard on 2012-07-19.
// wtfpl
//
@gasp
gasp / mamp.sh
Created July 21, 2012 22:29
useful mamp terminal controller
# /bin/sh
case $1 in
start)
/Applications/MAMP/bin/startMysql.sh
/Applications/MAMP/bin/startApache.sh
;;
stop)
/Applications/MAMP/bin/stopMysql.sh
/Applications/MAMP/bin/stopApache.sh
@gasp
gasp / strlen.php
Created September 24, 2012 13:21
recursive function
// the shortest strlen function
function cc($s){
if(($ss = substr($s,1))!='') return 1+cc($ss);
else return 1;
}
@gasp
gasp / articles et auteurs liés au projet
Created November 8, 2012 09:44
boucle à refactoriser
<h2>Rôles et auteurs</h2>
<B_equipe>
<ul>
<BOUCLE_equipe(projets_liens){id_projet}>
<BOUCLE_equipe_auteur(AUTEURS){tous}{id_auteur=#ID_OBJET}>
<li>
<a href="#URL_AUTEUR">#NOM</a>
[((#_equipe:ROLE|role{auteur}))]
</BOUCLE_equipe_auteur>
</li>
@gasp
gasp / ortc-1.js
Created November 28, 2015 10:41 — forked from kypflug/ortc-1.js
navigator.mediaDevices.getUserMedia ({
"audio": true,
"video": {
width: 640,
height: 360,
facingMode: "user"
}
}).then(
gotStream
).catch(
@gasp
gasp / README.md
Last active December 14, 2015 14:09 — forked from aronwoost/README.md

On my dev server

##Install git

su
apt-get install git-core

##Create ssh directory since it doesn't exists by default on the Amazon AMI