Skip to content

Instantly share code, notes, and snippets.

View ochafik's full-sized avatar

Olivier Chafik ochafik

View GitHub Profile
@oskar456
oskar456 / wgcf.py
Last active February 17, 2024 12:47
Cloudflare WARP linux client (using wg-quick for actual tunnel setup)
#!/usr/bin/env python3
import subprocess
import json
import os
from pathlib import Path
import requests
from requests.compat import urljoin
#!/usr/bin/env bash
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\
function register_clang_version {
local version=$1
local priority=$2
update-alternatives \
--install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone git@gist.github.com:<hash>.git     # or with ssh
@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 / 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;
@cvogt
cvogt / gist:8672a3fd97bc97714822
Last active August 8, 2023 13:55
Default values for type parameters in Scala
scala> :paste
class :=[T,Q]
trait Default_:={
/** Ignore default */
implicit def useProvided[Provided,Default] = new :=[Provided,Default]
}
object := extends Default_:={
/** Infer type argument to default */
implicit def useDefault[Default] = new :=[Default,Default]
}
@damondouglas
damondouglas / Angular-Dart-Check-Lists.md
Last active April 27, 2017 06:45
Angular Dart Check Lists

Angular Dart Check List

The following shows what to watch out for when making Angular Dart applications. For more information about Angular Dart, see angulardart.org.

Table Of Contents

@composite
composite / json.stringify.js
Created January 13, 2014 08:26
JSON stringify with escape unicode characters. http://stackoverflow.com/a/4901205/489575
function JSON_stringify(s, emit_unicode)
{
var json = JSON.stringify(s);
return emit_unicode ? json : json.replace(/[\u007f-\uffff]/g,
function(c) {
return '\\u'+('0000'+c.charCodeAt(0).toString(16)).slice(-4);
}
);
}