Skip to content

Instantly share code, notes, and snippets.

View 131's full-sized avatar
💭
working on cloudfs

François Leurent 131

💭
working on cloudfs
View GitHub Profile

Keybase proof

I hereby claim:

  • I am 131 on github.
  • I am 131 (https://keybase.io/131) on keybase.
  • I have a public key whose fingerprint is 5271 EBE8 2E2F 790E 3D2C 50FA D2DF A7DB 5CF5 691A

To claim this, I am signing this object:

@131
131 / pg-async-transactions.js
Last active April 24, 2016 20:50
Proposal for pg-async transaction stack
"use strict";
var values = function(obj){
var val = []
Object.keys(obj).forEach(function(key) {
val.push(obj[key]);
});
return val;
};
var ClapEngine = require('clap-trigger');
var hue = require("node-hue-api");
var HueApi = hue.HueApi;
var lightState = hue.lightState;
var hostname = "192.168.131.47";
var user_id = 'iwonttell';
var api = new HueApi(hostname, user_id);
var trigger = new ClapEngine();
<?
function stop(){
if(!file_exists(self::PID_FILE))
return;
$pid = file_get_contents(self::PID_FILE);
posix_kill($pid, SIGTERM);
unlink(self::PID_FILE);
rbx::ok("Stopped $pid");
}
@131
131 / gist:4c782158e61921323a9445fbe13563d4
Last active October 11, 2016 22:53
Static context in ES6 classes

Long story short, in javascript "this" refer to the thing-on-the-left-side-of-the-dot. period.

So, when writing ES6 classes & statics methods, use "this" to refer to the static classe.

class User {
@131
131 / proxy_connect.diff
Created December 27, 2016 00:07
Apache ProxyRemote with Proxy-Authorization (over connect/HTTPS)
Index: mod_proxy.c
===================================================================
--- mod_proxy.c (revision 1205172)
+++ mod_proxy.c (working copy)
@@ -965,7 +965,8 @@
access_status = proxy_run_scheme_handler(r, worker,
conf, url,
ents[i].hostname,
- ents[i].port);
+ ents[i].port,

minimal curl/wget, with binary file support

function __curl() {
  read proto server path <<<$(echo ${1//// })
  DOC=/${path// //}
  HOST=${server//:*}
  PORT=${server//*:}
  [[ x"${HOST}" == x"${PORT}" ]] && PORT=80
@131
131 / readdir.js
Created October 14, 2018 21:26
async iterator, are needed
"use strict";
//this requires node 10 magical
const fs = require('fs');
const path = require('path');
const promisify = require('nyks/function/promisify');
remote_read:
- url: https://prometheus.gra1.metrics.ovh.net/remote_read
basic_auth:
username: ''
password: '<redacted>'
remote_write:
- url: https://prometheus.gra1.metrics.ovh.net/remote_write
basic_auth:
@131
131 / noautofill.md
Last active November 17, 2021 22:58
Prevent autofill / password completion
<textarea required="required" autocorrect="off" autocapitalize="off" name="username" class="form-control" placeholder="Your username"  rows="1" cols="20" wrap="off"></textarea>
<textarea required="required" autocorrect="off" autocapitalize="off" name="password" class="form-control password" placeholder="Your password"  rows="1" cols="20" wrap="off"></textarea>
@font-face {