Skip to content

Instantly share code, notes, and snippets.

View catwell's full-sized avatar

Pierre Chapuis catwell

View GitHub Profile
@catwell
catwell / main.js
Created July 3, 2019 11:51 — forked from kdzwinel/main.js
List all undefined CSS classes
/*
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.
$ file influx
influx: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=uMU53wvzHnFpSrXlZpve/r3sWHwiEQPAZqdqJ9rUc/afXu0dqCbsXHZR7Kl3YS/yh-Le_wZmV-Trkcx9mca, with debug_info, not stripped
$ ldd influx
not a dynamic executable
@catwell
catwell / verif.md
Created July 16, 2018 10:20
verification-id

Le responsable du traitement devrait prendre toutes les mesures raisonnables pour vérifier l'identité d'une personne concernée qui demande l'accès à des données, en particulier dans le cadre des services et identifiants en ligne. Un responsable du traitement ne devrait pas conserver des données à caractère personnel à la seule fin d'être en mesure de réagir à d'éventuelles demandes.

(source)

Lorsque le responsable du traitement a des doutes raisonnables quant à l'identité de la personne physique présentant la demande visée à l'article 14 ou 16, il peut demander que lui soient fournies des informations supplémentaires nécessaires pour confirmer l'identité de la personne concernée.

Lorsque le responsable du traitement demande que des informations supplémentaires lui soient fournies pour confirmer l'identité de la personne concernée, il convient que ces informations fassent l'objet d'un traitement uniquement pour cette finalité précise et q

  1. Does everyone in the organization have access to all of the codebase by default?
    • Single source manager for the entire organization (also supports managing and publishing documentation, typically GitLab or GitHub).
  2. Is the codebase structured or documented in a way that makes it easy to explore?
    • Don't follow the org chart (changes over time) use a stable functional layout (e.g. domain / product / component).
  3. Do individual projects have a documented mission? (Typically in README.md)
    • Single main problem the project is solving for the users. Crucial to constrain scope.
  4. Do individual projects have a documented and straightforward contribution process? (Typically CONTRIBUTING.md)
    • Anyone should be able to build, test, run with very few steps.
  5. Are all contributors treated equally (i.e. teams / maintainers follow a different process)?
  • Applies to coding guidelines, expectations, SLA for patch reviews, testing...
@catwell
catwell / encode-with-ffi.lua
Created May 16, 2018 18:41
Encode stuff with LuaJIT FFI
-- https://twitter.com/kellabyte/status/996803727477489664
local ffi = require "ffi"
local key = "12345" -- your key
local value = "somethingelse" -- your value
local key_len = #key
local value_len = #value
-- If you need pure Lua *and* don't need crypto strength.
local function random_keys(n)
local t = {}
return function()
for i = 1, n do t[i] = string.char(math.random(0, 255)) end
return table.concat(t)
end
end
@catwell
catwell / buggy-gcc-Wundefined.c
Created May 4, 2018 09:52
Do not rely on compiler warnings.
#include <stdio.h>
int foo(void) {
return 1;
}
int buggy(void)
{
int len;
/* GCC with -Wall -Wextra will not warn.
@catwell
catwell / plc-box-api-example.lua
Created August 13, 2017 11:21
Example of how to use the new box API from PLC
local box = require "box"
-- all keys are 32 bytes long
local f = io.open("/dev/urandom")
-- generate secret keys for Alice and Bob
local sk_a = assert(f:read(32))
local sk_b = assert(f:read(32))
@catwell
catwell / lima-lua-style-1-general.md
Last active August 21, 2022 15:24
Lima Lua style

Lima Lua style guide

About this style guide

How to read this style guide

Refer to RFC 2119 to interpret MUST, SHOULD and MAY.

Inspiration