Skip to content

Instantly share code, notes, and snippets.

View ochafik's full-sized avatar

Olivier Chafik ochafik

View GitHub Profile
@ochafik
ochafik / burkini.md
Created August 26, 2016 05:18
Opinion(Burkini été 2016): Délit de terrorisme vestimentaire passif: à qui profite la persécution religieuse?

Délit de terrorisme vestimentaire passif: à qui profite la persécution religieuse?

Toute ressemblance avec l'affaire du racolage passif serait purement fortuite.

Ne nous voilons pas la face: en matière de politique publique, ce n'est pas l'intention qui compte, ce sont les résultats.

Eh bien quid justement des intentions en jeu dans l'affaire du burkini, et des résultats probables?

Je vois grosso modo 3 profils majeurs pour nos bien-intentionnés amis anti-burkini:

@ochafik
ochafik / serve.py
Last active June 18, 2016 14:22
Dart Development Server
#!/usr/bin/env python
# https://gist.github.com/ochafik/9929ec51d3c4d3d613b71b5f5b45130b
# For SPDY / HTTP2 push: https://github.com/eigengo/opensourcejournal/blob/master/2014.1/spdynetty/spdynetty.md
import getopt
import os
import re
import sys
import threading
import urllib
@ochafik
ochafik / move_ddc_runtime_js_to_dart.sh
Created December 13, 2015 20:05
move_ddc_runtime_js_to_dart.sh
# {rtti,types,classes,errors,generators,operations,runtime}
for lib in rtti types classes errors generators operations runtime ; do
#_internal/compiler/js_lib/runtime.dart
js=lib/runtime/dart/_$lib.js
dart=tool/input_sdk/private/$lib.dart
if [[ ! -f $dart || "$FORCE" == "1" ]]; then
# ( cat $js | grep '\.\.\.' > /dev/null ) ||
cat $js | \
# egrep -v '^ exports.' |
egrep -v "'use strict'" | \
/**
* Gets a property descriptor for a target instance, skipping its class
* and walking up the super-classes hierarchy.
*
* @private
* @param {!Object} target
* @param {!string} name
* @return {!Object.<ObjectPropertyDescriptor>|undefined}
*/
$jscomp.getSuperPropertyDescriptor_ = function(target, name) {
@ochafik
ochafik / template.html
Created September 4, 2015 14:15
skygular
<!--
Widget build() {
return new Scaffold(
toolbar: buildToolBar(),
body: buildBody()
);
}
}-->
<paper-scaffold>
<paper-header-panel>
@ochafik
ochafik / functions.js
Last active August 27, 2015 14:30
Experiment on Closure Compiler's function types (behaviour of all '*' vs. unknown '?')
// Run with:
// java -jar compiler.jar --language_in=ECMASCRIPT6_STRICT -O ADVANCED --warning_level VERBOSE functions.js
/**
* @param {function(*)} f1 ERROR
* @param {function(*):*} f2 ERROR
* @param {function(?):*} f3
* @param {function(*):?} f4 ERROR
* @param {function(?):?} f5
* @param {function()} f6 ERROR
@ochafik
ochafik / async_example.dart
Last active August 29, 2015 14:23
Simple example of async/await transform for Dart's dev_compiler (see https://github.com/dart-lang/dev_compiler/issues/221)
// Run with dart:
// dart async_example.dart
import 'dart:async';
f(g) async {
try {
final value = await g();
return 'Result: ' + (value + 1);
} catch (e) {
if (e == 'rethrow me') throw e;
return 'Caught: ' + e;
@ochafik
ochafik / proxy_polyfill.js
Last active August 29, 2015 14:08
Poor man's Proxy polyfill
function registerOnLoad(fn) {
var prev = window.onload;
window.onload = !prev ? fn : function() {
var prevResult = prev();
return prevResult instanceof Promise ? prevResult.then(fn) : fn();
};
}
if (!this['Proxy']) {
var PolyfillProxy = function(target, handlers) {
@ochafik
ochafik / designer.html
Created October 15, 2014 17:53
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../ace-element/ace-element.html">
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
import com.nativelibs4java.opencl.*;
import org.bridj.*;
import static org.bridj.Pointer.*;
/*
Put these lines in `build.sbt`, and run with `sbt ~run`:
fork := true