Skip to content

Instantly share code, notes, and snippets.

@dax
dax / ka.csv
Last active June 7, 2023 12:28
Migration
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
5b04af9c-ce46-4c3d-9360-86d00da59afd
3ea73d6e-21f8-4acb-a4c5-b05029fed927
2f90d77a-e791-4f90-a9b8-d926cd04bce3
914122ce-8856-426d-8868-cf9dd310b5aa
ff13d1d0-a215-47af-8569-57126d753efd
a783a108-7412-4f39-9bed-49f3fdb0d30b
3351
738d3eab-abe9-47a4-8e7d-e2c469a53e21
2427
23721
@dax
dax / listener.js
Created September 29, 2017 10:39
PostgreSQL notify/listen demo
// npm install pg
// bootstrap : psql -h localhost test test
// create table config(id serial, conf json);
// insert into config (conf) values ('{"test": 42}'::json);
var pg = require('pg');
var Pool = pg.Pool;
var pool = new Pool({
user: 'test',
@dax
dax / gist:f60ea701e1fba98bfa47
Last active August 29, 2015 14:12
URL Minifier instructions

URL Minifier

Develop it

  1. Choose your favorite web technology to develop an URL minifier
  2. a form should take an URL to minify and return the minified URL
  3. when requested (a GET on HTTP) on the path of a minified URL, your application should reply a 301 HTTP code and redirect to the unminified URL
  4. When done, send us a Git repo URL

Deploy it

@dax
dax / gist:f4f0200eef2bde3a93a6
Last active August 29, 2015 14:11
keybase.md

Keybase proof

I hereby claim:

  • I am dax on github.
  • I am drousselie (https://keybase.io/drousselie) on keybase.
  • I have a public key whose fingerprint is 83F3 B41C 61ED 0DB4 0FBA BDC3 FB48 7E96 8EEE EE35 To claim this, I am signing this object:
{
    "body": {
        "client": {
@dax
dax / htmlparser-test.js
Created August 16, 2013 15:03
Our test of the wrapped node-htmlparser2
var should = require('should'),
sinon = require('sinon'),
Factory = require('./object-factory'),
helper = require('./test-helper'),
htmlModule = require('../common/content/html'),
HTML = htmlModule.HTML,
currentEventIndex = 0;
function stubAndCheck(html, eventName, expectedEvents) {
html.processors = [html.processors[0]];
@dax
dax / apt_key
Created August 6, 2012 15:32
Ansible playbook
#!/usr/bin/python
import subprocess
import re
import traceback
import tempfile
def execute(args, module, shell=None):
try:
cmd = subprocess.Popen(args, shell=shell,