Skip to content

Instantly share code, notes, and snippets.

View adriengibrat's full-sized avatar
:octocat:
open sourcing when not too busy

Adrien Gibrat adriengibrat

:octocat:
open sourcing when not too busy
View GitHub Profile
@SwitHak
SwitHak / 20211210-TLP-WHITE_LOG4J.md
Last active April 18, 2024 11:20
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-20 2238 UTC

Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)

Errors, typos, something to say ?

  • If you want to add a link, comment or send it to me
  • Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak

Other great resources

  • Royce Williams list sorted by vendors responses Royce List
  • Very detailed list NCSC-NL
  • The list maintained by U.S. Cybersecurity and Infrastructure Security Agency: CISA List
@sergey-shpak
sergey-shpak / lens.js
Last active May 25, 2019 13:02
Hyperapp V2 actions state lens
/*
This is variation of `squirrel` and `namespace` approaches
https://gist.github.com/zaceno/0d7c62be81a845857e755c1378b7dbff
https://gist.github.com/sergey-shpak/5817bf146cb970bc4e259aef71b89ef4
Simplifies Hyperapp#v2 actions work with deeply nested state
(updated to support returned actions, parameterized actions)
Usage examples:
@branneman
branneman / fp-lenses.js
Last active May 17, 2023 00:56
JavaScript: Lenses (Functional Programming)
// FP Lenses
const lens = get => set => ({ get, set });
const view = lens => obj => lens.get(obj);
const set = lens => val => obj => lens.set(val)(obj);
const over = lens => fn => obj => set(lens)(fn(view(lens)(obj)))(obj);
const lensProp = key => lens(prop(key))(assoc(key));
@adriengibrat
adriengibrat / messageformat.js
Last active July 20, 2016 07:15
messageformat with format & debug
var mf = (function () {
'use strict';
function warn () {
/* eslint no-console: off, prefer-spread: off */
console.warn.apply(console, arguments)
}
function error (message) {
/* eslint no-var: off */
@adriengibrat
adriengibrat / uuid.js
Created July 5, 2016 23:34
simple uuid generator for evergreen browsers
// see https://tools.ietf.org/html/rfc4122#section-4.4
function uuid () {
var seeds = random(12)
// inspired by https://github.com/broofa/node-uuid/blob/v2.0.0/uuid.js#L362
seeds[5] = (seeds[5] & 0x0fff) | 0x4000 // version bits
seeds[7] = (seeds[7] & 0x3fff) | 0x8000 // clock_seq_hi_and_reserved bits
return 'xx-x-x-x-xxx'.replace(/x/g, function (x, index) { return hex(seeds[index]) })
function random (n) { // get n random 16-bit unsigned integers
@adriengibrat
adriengibrat / plural.js
Last active May 30, 2017 08:14
simple CLDR plural rules parser
#!/usr/bin/env node
/**
* plural.js – simple CLDR plural rules parser
* https://gist.github.com/adriengibrat/817140a89cfd4893b4155a2ac913904d
*
* This program is free software. It comes without any warranty.
* Released under the WTFPL license – http://www.wtfpl.net
*
* Usage:
@ericclemmons
ericclemmons / example.md
Last active February 22, 2024 16:18
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@robwormald
robwormald / app.ts
Last active May 29, 2016 01:49
angular2 + rx + ts
import {Component, View, bootstrap, CORE_DIRECTIVES, ON_PUSH, LifecycleEvent, ElementRef} from 'angular2/angular2';
import {NgFormModel, NgControl,FormBuilder, FORM_BINDINGS, FORM_DIRECTIVES} from 'angular2/forms'
import {RxPipe} from './rxPipe'
import {Observable} from 'rx.all'
@Component({
selector: 'hello',
lifecycle: ON_PUSH
})
@padraic
padraic / checksslcontext.php
Last active October 29, 2020 01:10
Correct SSL/TLS Context Settings for file_get_contents() and other PHP stream calls under PHP 5.5 (or earlier)
<?php
ini_set('display_errors', 1);
/**
* This script check how PHP makes HTTPS (SSL/TLS) requests using PHP Streams
* or cURL. Configuration options are passed as GET parameters, for example:
* http://localhost/checksslcontext.php?reconfigure=1
*
* Configuration:
* http://localhost/checksslcontext.php
* Basic PHP Streams using file_get_contents(). Default settings.
/**
* User Timing polyfill (http://www.w3.org/TR/user-timing/)
* @author RubaXa <trash@rubaxa.org>
*/
(function (window){
var
startOffset = Date.now ? Date.now() : +(new Date)
, performance = window.performance || {}
, _entries = []