Skip to content

Instantly share code, notes, and snippets.

View xvw's full-sized avatar

Xavier Van de Woestyne xvw

View GitHub Profile
@xvw
xvw / Pillar.pillar
Created February 6, 2015 15:39
Pillar update (for broken links)
{{title: Pillar}}
!Documenting your Project with Pillar
!!Introduction
*Pillar>http://www.smalltalkhub.com/#!/~Pier/Pillar* is a markup syntax and associated tools to write and generate documentation and books. Pillar is currently used to write the *Enterprise Pharo book>https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise* and other projects (see Section *pillarUSERS*). The Pillar screenshot below (see Figure *voyageDocExample*) shows a part of the *Voyage documentation>https://github.com/SquareBracketAssociates/PharoForTheEnterprise-english/blob/master/MigratedToOtherPlaces/Voyage/Voyage.pier* generated by Pillar.
+An example Pillar output>file://figures/voyageDocExample-small.png|label=voyageDocExample|width=30+
@xvw
xvw / springer-free-maths-books.md
Created December 29, 2015 01:22 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@xvw
xvw / choice.rb
Created January 10, 2016 21:09
Choice
# coding: utf-8
# Une version "sans sécurité" mais qui explique un peu l'idée
class Choice
def initialize(prompt)
@prompt = prompt
@choices = []
end
<html data-phun-id="html_5694e2dc109da" lang="en"><head data-phun-id="head_5694e2dc108e5"><meta data-phun-id="meta_5694e2dc10920" charset="utf8"><title data-phun-id="title_5694e2dc1095f">Exception: VariantNotInCallback</title><link data-phun-id="link_5694e2dc10a3d" type="text/css" rel="stylesheet" href="//localhost/phun/phun/css/font-awesome.min.css" media="screen"><link data-phun-id="link_5694e2dc10a91" type="text/css" rel="stylesheet" href="//localhost/phun/phun/css/debugger.css" media="screen"></head><body data-phun-id="body_5694e2dc1099c"><div data-phun-id="div_5694e2dc10c50" class="phun-debug-toolbox"><a data-phun-id="a_5694e2dc10b57" href="/phun/"><i data-phun-id="i_5694e2dc10ad7" class="fa fa-refresh"></i><span data-phun-id="span_5694e2dc10b1a" class="phun-debug-tooltip">Refresh the current service</span></a><a data-phun-id="a_5694e2dc10c15" href="/phun/"><i data-phun-id="i_5694e2dc10b92" class="fa fa-clock-o"></i><span data-phun-id="span_5694e2dc10bd9" class="phun-debug-tooltip">19.505023956299 ms</sp
@xvw
xvw / phun-sample.html
Created January 13, 2016 10:48
a Sample output
<!doctype html>
<html data-phun-id="html_56962b39ab666" lang="en">
<head data-phun-id="head_56962b39ab57b">
<meta data-phun-id="meta_56962b39ab5b4" charset="utf8" />
<title data-phun-id="title_56962b39ab5f0">Exception: VariantNotInCallback</title>
<link data-phun-id="link_56962b39ab6c2" type="text/css" rel="stylesheet" href="//localhost/phun/phun/css/font-awesome.min.css" media="screen" />
<link data-phun-id="link_56962b39ab716" type="text/css" rel="stylesheet" href="//localhost/phun/phun/css/debugger.css" media="screen" />
</head>
<html data-phun-id="html_5698f975daa21" lang="en">
<head data-phun-id="head_5698f975da93f">
<meta data-phun-id="meta_5698f975da976" charset="utf-8">
<title data-phun-id="title_5698f975da9af">No service as a candidate</title>
<link data-phun-id="link_5698f975daa70" type="text/css" rel="stylesheet" href="//localhost/phun/phun/css/font-awesome.min.css" media="screen">
<link data-phun-id="link_5698f975daab7" type="text/css" rel="stylesheet" href="//localhost/phun/phun/css/debugger.css" media="screen">
</head>
<body data-phun-id="body_5698f975da9e8">
@xvw
xvw / hideopen.php
Last active January 15, 2016 14:03
<?php
protected static function hide_show($button, $code, $h='Hide', $s='Show') {
$js_trigger = new Js\Callback(function($e) use($code, $h, $s) {
$value = $e->get('target')->get('value');
$text = Js\Variable::createFresh(Js\string($h));
$disp = Js\Variable::createFresh(Js\string('flex'));
return $text->onTop() . $disp->onTop() . new Js\IfElse(
$value->equals(Js\string($h)),
function() use ($text, $disp, $h, $s) {
return $disp->set(Js\string('none')) .';'
open Bootstrapper
(* Side effects *)
let current_slide = ref 0
(* Low level function *)
let doc =
Dom_html.document ## documentElement
(*
* ppx_measure is a general purposition to add unit of measure in OCaml
*
* Copyright (c) 2015 Xavier Van de Woestyne <xaviervdw@gmail.com>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
open Printf
open Parsetree
open Asttypes
open Ast_helper
let create_loc ?(loc = !default_loc) value = {
txt = value
; loc = loc
}