Skip to content

Instantly share code, notes, and snippets.

View yloiseau's full-sized avatar

Yannick Loiseau yloiseau

View GitHub Profile
@yloiseau
yloiseau / FirstOrderModule.md
Created January 15, 2016 11:27
First order modules in Golo

Just a POC on a discussion we had with @Artpej

Given

module MyMod

function foo = |a, b| -> a + b

function bar = -> println("MyMod.bar")
module checks
function checkWithFallback = |log, message, predicate, fallback| -> |value| {
case {
when predicate(value) {
return value
}
otherwise {
log: add(message)
log: add("use %s instead": format(fallback))
#!/bin/bash
#
# Copyright © 2016 Yannick Loiseau <[email protected]>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
#
#==============================================================================
# Script to check if you are working on a project with Watson and display a
# notification when:
@yloiseau
yloiseau / watson-conky.md
Last active May 27, 2016 08:14
Watson i3 status (via conky)

To display the current watson status in your i3 bar using conky:

  • in the conky configuration, add:
{"full_text": "${texeci 5 ~/.config/i3/watson-status}"}
  • in ~/.config/i3/watson-status:
#!/bin/bash
watson status |
sed -r '
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2016 Yannick Loiseau <[email protected]>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
"""
on-modify hook for taskwarrior.
This hook connects taskwarrior and watson.
module TestObservable
function main = |args| {
let o1 = Observable(null)
let o2 = o1: map(|v| -> v + 1): onChange(|v| {println(v)})
o1: set(0)
}