Skip to content

Instantly share code, notes, and snippets.

View mathieucaroff's full-sized avatar

Mathieu CAROFF mathieucaroff

View GitHub Profile
@mathieucaroff
mathieucaroff / negateExitCode.js
Created June 5, 2023 08:52
node JS script to negate the exit code of the command passed as parameter
/**
* Spawn the given command with its arguments, exit with the inverse of the
* exit code of the spawned command: exits 0 if the code is anything other
* than 0, and exits with 1 if the code is 0.
*
* Usage:
*
* node scripts/utils/negateExitCode.js <command> [<arguments>...]
*
* Examples:
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<style>
</style>
</body>
</html>
@mathieucaroff
mathieucaroff / ISC.txt
Created September 17, 2021 11:04
ISC (723) vs MIT (1060) vs NTP (695)
Copyright <YEAR> <OWNER>
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@mathieucaroff
mathieucaroff / findautoelevate.ps1
Created August 19, 2021 21:24 — forked from Evilcry/findautoelevate.ps1
Enumerate executables with auto-elevation enabled
# Find Autoelevate executables
Write-Host "System32 Autoelevate Executables" -ForegroundColor Green -BackgroundColor Black
Select-String -Path C:\Windows\System32\*.exe -pattern "<AutoElevate>true"
Write-Host "`nSysWOW64 Autoelevate Executables" -ForegroundColor Green -BackgroundColor Black
Select-String -Path C:\Windows\SysWOW64\*.exe -pattern "<AutoElevate>true"
// ==UserScript==
// @name Align Youtube Ponies@Dawn
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Make the video always occupy the same column, so as to make them easier to find
// @author Mathieu CAROFF
// @match https://www.youtube.com/channel/UCSJW3EMxeuQXZ00h4bihXvA/videos
// @grant none
// ==/UserScript==
@mathieucaroff
mathieucaroff / .tmux.conf
Last active June 10, 2020 16:26 — forked from jnaulty/.tmux.conf
A copy of the best tmux and vim configuration in the universe
#.tmux.conf
# upstream
# https://gist.github.com/jnaulty/55d03392c37e9720631a
# obtain
# ```bash
# curl https://gist.githubusercontent.com/mathieucaroff/7037f7f40e359d6a605638872bfd19c2/raw/.tmux.conf --output ~/.tmux.conf
# ```
package main
// An example of use of the go yaml v3 Node API
// Disclaimer: I'm very new to go. This code may miss a lot of Go goodnesses
import (
"bytes"
"fmt"
"io"
"log"
var MAX_DEPTH = 20
export var expandedLog = (obj: Record<string, unknown>, depth: number = 0) => {
var [[name, item]] = Object.entries(obj)
if (depth < MAX_DEPTH && typeof item === 'object' && item) {
var typeString = Object.prototype.toString.call(item)
var objType = typeString.replace(/\[object (.*)\]/, '$1')
console.group(`${name}: ${objType}`)
Object.entries(item).forEach(([key, value]: any) => {
@mathieucaroff
mathieucaroff / git-setup-snippet.md
Created January 28, 2019 22:18
A copy-past of the default helper snippets shown on Gitlab in empty repositories (2019-01-28)

Command line instructions

Git global setup

git config --global user.name "Mathieu CAROFF"
git config --global user.email "[email protected]"

Create a new repository