Skip to content

Instantly share code, notes, and snippets.

View abourget's full-sized avatar

Alexandre Bourget abourget

View GitHub Profile
@abourget
abourget / webrtcstuff.js
Created March 13, 2012 05:26
Simple WebRTC initiation code
if(window.Audio) {
var audio = new Audio("notification.ogg")
}
var name = ""
var name_el = <input maxlength=18 placeholder=_Name>
var name_error_el
var name_form_el
var message_list_el
var message_form_el
var message_ids = {}
@abourget
abourget / dust_lib_server.js
Created March 30, 2012 04:00
A quick and dirty dust.js command line compiler (written in NodeJS, for use elsewhere)
// you need to take out this line for it to work with node 0.6+:
// comment out this line in the dust/lib/server.js file after "npm install dust":
require.paths.unshift(path.join(__dirname, '..'));
// otherwise, you'll get:
/*
node test/server.js
@abourget
abourget / development.ini
Created April 3, 2012 16:55
Using DustJS + WebAssets + Pyramid
webassets.base_dir=%(here)s/myapp
webassets.base_url=/
webassets.debug=True
webassets.updater=timestamp
webassets.cache=True
webassets.DUSTY_PATH=/path/to/myapp/node_modules/dusty/bin/dusty
# after installation, following instructions here:
# https://github.com/abourget/webassets/blob/master/src/webassets/filter/dust.py#LC16
@abourget
abourget / directives.js
Created August 8, 2012 20:24
Hammer.js integration with AngularJS
/**
* Inspired by AngularJS' implementation of "click dblclick mousedown..."
*
* This ties in the Hammer events to attributes like:
*
* hm-tap="add_something()"
* hm-swipe="remove_something()"
*
* and also has support for Hammer options with:
*
@abourget
abourget / ssh.py
Created November 30, 2012 16:43
Ansible helper to connect to remote nodes via ssh, using the Ansible inventory
#!/usr/bin/env python
#
# This is a script we use at Tenscores, and it is specific only in the sense that we use IP addresses
# and use the variable `hostname` to find the correct nodes. Also, it connect to user `ubuntu` by
# default.. that could be checked up in the vars too.
#
# Our hosts file looks like:
#
#[appservers]
@abourget
abourget / dartIrcbot.dart
Last active December 17, 2015 11:38 — forked from adam-singer/dartIrcbot.dart
Updated for M4
import "dart:io";
import "dart:utf";
import 'dart:json' as JSON;
import 'dart:async';
import 'dart:isolate' as isolate;
import 'dart:mirrors';
String API_KEY = "INSERT_KEY_HERE";
class Bot {
@abourget
abourget / main.go
Last active March 5, 2016 03:33
In my package's `gen/` folder
package main
import (
"fmt"
"strings"
_ "github.com/abourget/featurette/design"
"github.com/goadesign/goa/design"
"github.com/goadesign/goa/dslengine"
@abourget
abourget / main.go
Last active March 12, 2016 20:01
Sample security middleware for goa's Security framework..
...
func serve() error {
service := goa.New("Featurette")
publicKeys := loadJWTPublicKeys(service)
...
// JWTSecurity was generated, because I named my security method "jwt"
@abourget
abourget / keybase.md
Created March 29, 2017 14:33
Keybase proof

Keybase proof

I hereby claim:

  • I am abourget on github.
  • I am abourget (https://keybase.io/abourget) on keybase.
  • I have a public key ASDOwPRLvU0tt95s4Kx0mbdy76giDFpfPBLizucn60qPhgo

To claim this, I am signing this object:

{
"expiration": "2018-07-09T13:09:20",
"ref_block_num": 955,
"ref_block_prefix": 2477295815,
"max_net_usage_words": 0,
"max_cpu_usage_ms": 0,
"delay_sec": 0,
"context_free_actions": [],
"actions": [
{