Skip to content

Instantly share code, notes, and snippets.

View madx's full-sized avatar

François Vaux madx

View GitHub Profile
@madx
madx / test.sh
Last active August 29, 2015 14:04
Test runner with tape + tap-dot
#!/bin/bash
TEST_FILES=`find test/ -name "*.js"`
run_tests() {
local tests="$@"
for test in $tests; do
echo -ne "\033[1;33m$test\033[0m"
tape $test | tap-dot
/**
* Usage:
*
* DOM("div#notebook")
* DOM("ul.tabs[data-target=notebook]")
*/
var DOM = function(selector, textContent) {
var tokens = selector.split(/\b/)
var tagName = tokens.shift()
@madx
madx / rc.lua
Created May 6, 2014 07:20
My Awesome config
-- Standard awesome libraries
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
local menubar = require("menubar")
awful.rules = require("awful.rules")
@madx
madx / has_events.js
Created April 8, 2014 14:17
Simple Events as a functional mixin
var hasEvents = (function() {
function on(name, callback, listener) {
var listener = listener || this
this._events = this._events || []
this._events.push({
name: name,
callback: callback,
listener: listener
})
@madx
madx / README.md
Created April 8, 2014 08:54
Hipster CSS Preprocessor
$ cpp -P input.css
@madx
madx / Makefile
Last active August 29, 2015 13:56
Static website builder using Jade + Stylus
PAGES = $(shell find sources/pages -name *.jade 2>/dev/null)
LAYOUTS = $(wildcard sources/layouts/*.jade)
STYLESHEETS = $(filter-out %_.styl,$(wildcard sources/stylesheets/*.styl))
OTHER = $(shell find static -type f 2>/dev/null)
HTML = $(addsuffix .html,\
$(basename $(PAGES:sources/pages%=output%)))
CSS = $(addsuffix .css,\
$(basename $(STYLESHEETS:sources/stylesheets%=output/assets/css%)))
STATIC = $(OTHER:static/%=output/assets/%)
#!/bin/bash
function __my_git_dirty {
git diff --quiet 2>/dev/null || echo -e "*"
}
function __my_git_sha1 {
sha1="$(git log --no-color -1 --pretty=format:%h 2>/dev/null)"
if [ $? = 0 ]; then echo "$sha1"; fi
}
@madx
madx / Window management for Vim.md
Last active January 3, 2016 11:49
Simple window management for Vim

About

This little plugin eases working with windows in Vim. Put it in your plugins dir.

It provides 4 functions:

  • WMFocusMasterWindow: focuses the topmost-leftmost window
  • WMMarkWindowSwap: marks the current window for a later swap
  • WMDoWindowSwap: exchanges current window with marked window
[user]
name = "François Vaux"
email = [email protected]
identity = default
[identity "wyplay"]
name = "François Vaux"
email = [email protected]
[identity "default"]
name = "François Vaux"
email = [email protected]
#!/usr/bin/env ruby
require "ostruct"
require "json"
require "net/http"
SERVER_URI = URI("http://projects.hcilab.org/tapsnap/notification/php/get.php?version=10002")
# Seen notifications
@ids = []