Skip to content

Instantly share code, notes, and snippets.

View crubier's full-sized avatar
🛰️

Vincent Lecrubier crubier

🛰️
View GitHub Profile
@crubier
crubier / postgres_rls_rbac_inheritance_weirdness.sql
Last active July 20, 2022 10:06
Postgres RLS & RBAC don't behave as expected when combined with group inheritance...
DROP TABLE IF EXISTS post CASCADE;
DROP ROLE IF EXISTS author;
DROP ROLE IF EXISTS visitor;
DROP ROLE IF EXISTS basic;
-- Create roles

brew install zsh zsh-syntax-highlighting git kubernetes-cli kubernetes-helm nvm yarn pyenv awscli watchman terraform pkg-config cairo pango libpng jpeg giflib librsvg anttweakbar freeimage exiftool imagemagick cocoapods vips ffmpeg gifsicle

@crubier
crubier / flexboxadaptivelayering.markdown
Created June 28, 2017 15:55
FlexboxAdaptiveLayering
{
"accessors": {
"accessor_buffer_Bras#2_0": {
"bufferView": "bufferView_buffer_Bras#2_0",
"byteOffset": 0,
"byteStride": 32,
"componentType": 5126,
"count": 238,
"max": [
3.200000047683716,
@crubier
crubier / applyRegexToAllFilesInDirectory
Created January 17, 2017 10:51
Apply Regex to all files in directory, using node js
var fs = require('fs');
function readFiles(dirname, onFileContent, onError) {
fs.readdir(dirname, function(err, filenames) {
if (err) {
onError(err);
return;
}
filenames.forEach(function(filename) {
fs.readFile(dirname + filename, 'utf-8', function(err, content) {
@crubier
crubier / VietnameseSMT2
Created May 20, 2015 14:23
SMT2 Description of the vietnamese problem
;Nous déclarons 10 nombres entiers nommés a,b,c,...,i :
(declare-const a Int)
(declare-const b Int)
(declare-const c Int)
(declare-const d Int)
(declare-const e Int)
(declare-const f Int)
(declare-const g Int)
(declare-const h Int)
(declare-const i Int)</code>
@crubier
crubier / VietnameseProblemSolver
Created May 20, 2015 14:22
Vietnamese Problem Solver
for (var a = 1; a &lt;= 9; a++) {
for (var b = 1; b &lt;= 9; b++) {
for (var c = 1; c &lt;= 9; c++) {
for (var d = 1; d &lt;= 9; d++) {
for (var e = 1; e &lt;= 9; e++) {
for (var f = 1; f &lt;= 9; f++) {
for (var g = 1; g &lt;= 9; g++) {
for (var h = 1; h &lt;= 9; h++) {
for (var i = 1; i &lt;= 9; i++) {
if (a + 13 * b / c + d + 12 * e - f - 11 + g * h / i - 10 == 66) {