Skip to content

Instantly share code, notes, and snippets.

Avatar

Mathieu CAROFF mathieucaroff

  • IMT Atlantique
  • Saint-Renan
View GitHub Profile
@mathieucaroff
mathieucaroff / ISC.txt
Created Sep 17, 2021
ISC (723) vs MIT (1060) vs NTP (695)
View ISC.txt
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 Aug 19, 2021 — forked from Evilcry/findautoelevate.ps1
Enumerate executables with auto-elevation enabled
View findautoelevate.ps1
# 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"
View padaligner.alignyoutubeponiesatdawn.user.js
// ==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 Jun 10, 2020 — forked from jnaulty/.tmux.conf
A copy of the best tmux and vim configuration in the universe
View .tmux.conf
#.tmux.conf
# upstream
# https://gist.github.com/jnaulty/55d03392c37e9720631a
# obtain
# ```bash
# curl https://gist.githubusercontent.com/mathieucaroff/7037f7f40e359d6a605638872bfd19c2/raw/.tmux.conf --output ~/.tmux.conf
# ```
View linenumber.go
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"
View expandedLog.ts
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 Jan 28, 2019
A copy-past of the default helper snippets shown on Gitlab in empty repositories (2019-01-28)
View git-setup-snippet.md

Command line instructions

Git global setup

git config --global user.name "Mathieu CAROFF"
git config --global user.email "mathieu.caroff@free.fr"

Create a new repository

@mathieucaroff
mathieucaroff / util_str.vhd
Created Nov 20, 2018
VHDL Utilitary functions to convert std_logic_vector(s) to strings
View util_str.vhd
-- Mathieu CAROFF
-- 2018-11-20
-- util_str.vhd
-- Utilitary functions to convert std_logic_vector(s) to strings
-- Test:
-- ```bash
-- ghdl -a util_str.vhd
-- ghdl -r util_str_tb
-- ```
@mathieucaroff
mathieucaroff / sequenceView.py
Last active Jun 1, 2020
Create a (read only) slice without creating a copy of the given sequence.
View sequenceView.py
# stackoverflow.com/q/3485475/can-i-create-a-view-on-a-python-list
# This solution is based on python 3 range ability to be sliced and indexed
# in constant time.
#
# It supports slicing, equality comparsion, string casting, and reproducers,
# but doesn't support assigment (and I don't plan to add support for it).
#
# Creating a SliceableSequenceView of a SliceableSequenceView won't slow down
# access times as this case is detected.
@mathieucaroff
mathieucaroff / test-shell-default-variables.sh
Created Nov 6, 2018
Test shell variables to know how to determine path to the current shell script. Includes sample script output.
View test-shell-default-variables.sh
#!/bin/bash
# test-shell-default-variables.sh
# Usage examples (you might want to `sudo apt install zsh ksh`):
#
# ./test-shell-default-variables.sh dash bash
# ./test-shell-default-variables.sh dash bash zsh ksh
# ./test-shell-default-variables.sh dash bash zsh ksh | less -R