Skip to content

Instantly share code, notes, and snippets.

View gpolaert's full-sized avatar

Guillaume Polaert gpolaert

View GitHub Profile

Job board template

We are Pubstack

Founded in Paris, with team members everywhere!

We are a fast-growing startup, founded in July 2018, backed by prestigious investors, we have raised about 2M € in a seed round. Pubstack is a human adventure, we are building the most exceptional team to solve complex problems for our users.

Pubstack is a Software-as-a-Service platform with modern analytics and automation capabilities.

What We're Building

@gpolaert
gpolaert / machine.js
Created July 24, 2020 07:08
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// a
1000){r=r.substring(0,r.length-1);}return r;}());} var ftDomain = (window==top)?\"\":(function(){var d=document.referrer,h=(d)?d.match(\"(?::q/q/)+([qw-]+(q.[qw-]+)+)(q/)?\".replace(/q/g,decodeURIComponent(\"%\"+\"5C\")))[1]:\"\";return (h&&h!=location.host)?\"&ft_ifb=1&ft_domain=\"+encodeURIComponent(h):\"\";}()); var ftV_4625229={pID:\"4625229\",width:\"300\",height:\"250\",params:{ftx:window.ftX,fty:window.ftY,ftadz:window.ftZ,ftscw:window.ftContent,ft_custom:window.ftCustom,ft_id:window.ftID||\"\",ft_idEnabled:window.ftIDEnabled||\"\",ftOBA:window.ftOBA,ft_domain:((ftDomain||\"\").match(RegExp(\"&ft_domain=([^&$]+)\",\"i\"))||[\"\",\"\"])[1],ft_ifb:((ftDomain||\"\").match(RegExp(\"&ft_ifb=([^&$]+)\",\"i\"))||[\"\",\"\"])[1],ft_agentEnv:window.mraid||window.ormma?\"1\":\"0\",ft_referrer:encodeURIComponent(window.ft_referrer),cachebuster:window.ftRandom},winVars:{ftClick_4625229:window.ftClick_4625229,ftExpTrack_4625229:window.ftExpTrack_4625229,ft300x250_OOBclickTrack:window.ft300x250_OOBclickTrack
pbjs.requestBids({
// Handle bid responses
bidsBackHandler: () => {
// Iterate over all winning bids
const winningAds = pbjs.getHighestCpmBids();
// Iterate over all ad units
const ads = winningAds.map(winningAd => {
const adUnit = winningAd.adUnitCode;
@gpolaert
gpolaert / index.html
Created February 14, 2019 15:44
Prebid / Multiple aliases example
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=0.1">
<title>Demo</title>
<script src="//acdn.adnxs.com/prebid/not-for-prod/1/prebid.js"></script>
<script>
const adUnits = [
{
code: 'banner-div-1',
@gpolaert
gpolaert / libbeat.outputs.logmatic.logmatic.go
Created February 22, 2017 09:02
How to extend Elastic beats outputs by adding a plugin
package logmatic
import (
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/common/op"
"github.com/elastic/beats/libbeat/outputs"
"os"
)
@gpolaert
gpolaert / user-agent.txt
Last active March 27, 2024 06:18
A ramdom list of user-agent (windows, iOS, linux, and mobile devices)
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MDDCJS; rv:11.0) like Gecko
Mozilla/5.0 (Linux; U; Android 4.4.2; id; SM-G900 Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 UCBrowser/9.9.2.467 U3/0.8.0 Mobile Safari/534.30
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; ASU2JS; rv:11.0) like Gecko
Mozilla/5.0 (X11; Linux i686)
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MAARJS; rv:11.0) like Gecko
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 OPR/42.0.2393.517
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
@gpolaert
gpolaert / etc-init.d-perfstats-to-syslog.sh
Last active December 14, 2017 21:50
perfstats-to-syslog init.d script (lsb version)
#!/bin/sh
### BEGIN INIT INFO
# Provides: perfstats-to-syslog
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: perfstats-to-syslog is a daemon which collects system performance statistics periodically and stream it in clean JSON format to a syslog agent
### END INIT INFO
@gpolaert
gpolaert / plugins.json
Last active August 26, 2016 08:49
Boomerang
{
"plugins" : [
"plugins/rt.js",
"plugins/navtiming.js",
"plugins/restiming.js",
]
}
@gpolaert
gpolaert / app.js
Last active June 23, 2016 17:52
nodejs-talk
var template_engine = 'dust',
domain = 'localhost';
var express = require('express'),
routes = require('./routes'),
http = require('http'),
store = new express.session.MemoryStore,
path = require('path'),
flash = require('connect-flash'),
fs = require('fs');