Skip to content

Instantly share code, notes, and snippets.

View BoboTiG's full-sized avatar
🐍
Charmeur de serpents

Mickaël Schoentgen BoboTiG

🐍
Charmeur de serpents
View GitHub Profile
@Red-Eyed
Red-Eyed / 1. kill_vlc_on_resume.service
Last active December 18, 2022 14:25
kill vlc after suspend
[Unit]
Description=Kills VLC on resume in order to fix logging spam
[Service]
Type=oneshot
ExecStart=-/usr/bin/killall vlc
TimeoutSec=0
StandardOutput=syslog
After=suspend.target
@tekin
tekin / .gitattributes
Last active July 9, 2024 20:31
An example .gitattributes file that will configure custom hunk header patterns for some common languages and file formats. See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details.
# Stick this in your home directory and point your Global Git config at it by running:
#
# $ git config --global core.attributesfile ~/.gitattributes
#
# See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details
*.c diff=cpp
*.h diff=cpp
*.c++ diff=cpp
*.h++ diff=cpp
@matiasmorant
matiasmorant / pythonOneLiner.py
Last active July 30, 2021 01:02
Amazing Python One-Liner
This file has been truncated, but you can view the full file.
exec(''.join(chr(int(''.join(str(ord(i)-8203)for i in c),2))for c in '​​​‌​‌​‍‌‌‌​​‌‌‍‌‌​‌‌‌‌‍‌‌​‌‌‌​‍‌‌​​‌‌‌‍​‌‌‌‌​‌‍‌‌​​​‌​‍​‌​​‌‌‌‍‌​‌​​‌‌‍‌​‌​‌​‌‍‌​‌​​​‌‍‌‌‌‌​‌​‍‌​​​​​‌‍‌‌‌​‌‌‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​‌​​​​‍‌​​​‌‌​‍‌​‌​​‌​‍‌​‌‌​‌​‍‌​‌​​‌​‍‌​‌​‌‌​‍‌​​‌​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​‌‌​‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​‌‌​‌‍‌‌​‌​‌​‍‌​​​​​‌‍‌‌‌‌​​​‍‌​​‌‌‌‌‍‌​‌​‌‌​‍‌​‌​​‌​‍‌​​​‌‌​‍‌​‌​‌​​‍‌‌​‌​‌‌‍‌​​‌‌​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​‌​‌‌​‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​‌​‌​​‍‌​​​‌​‌‍‌​​​‌‌​‍‌​​‌‌‌​‍‌​‌​​‌​‍‌​‌​​‌‌‍‌​​​​‌​‍‌‌‌​​​​‍‌‌​​​‌​‍‌‌​‌​​‌‍‌​​​​‌​‍‌​​​‌‌‌‍‌​‌​‌​​‍‌​​​​‌‌‍‌​​​​‌​‍‌​‌​‌​​‍‌‌​​‌​​‍‌​​‌​​​‍‌​‌​‌‌​‍‌‌​‌​‌‌‍‌‌​​​​‌‍‌​‌​‌‌‌‍​‌‌‌​​​‍‌‌​​‌‌‌‍‌​​‌‌​‌‍‌‌​‌​‌​‍‌​​​​‌​‍‌​‌​‌​‌‍‌​‌​​​‌‍‌‌​‌‌​​‍‌​​​​‌​‍‌​​‌‌‌​‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​‌​‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​‌​​‍‌​​​‌​‌‍‌‌‌‌​​​‍‌​​‌‌‌​‍‌‌‌​‌‌​‍​‌​‌‌‌‌‍​‌‌​‌‌​‍‌​​‌​​‌‍‌​​​‌‌‌‍‌‌‌‌​‌​‍​‌‌‌​​‌‍​‌‌​‌‌​‍‌‌​​‌‌‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​​​​‌‍‌​​‌‌​​‍‌​‌‌​​‌‍‌​​​​​‌‍‌​‌​​​‌‍‌​​​​​‌‍‌​‌​‌​‌‍‌​
@HarshadRanganathan
HarshadRanganathan / .gitconfig
Created March 20, 2019 15:27
.gitconfig aliases
[alias]
##
# One letter alias for our most frequent commands.
#
# Guidelines: these aliases do not use options, because we want
# these aliases to be easy to compose and use in many ways.
##
a = add

Latency Comparison Numbers (~2012)

Name
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cachereference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
@benhoyt
benhoyt / atomic_counter.py
Created August 3, 2016 13:12
An atomic, thread-safe incrementing counter for Python
"""An atomic, thread-safe incrementing counter."""
import threading
class AtomicCounter:
"""An atomic, thread-safe incrementing counter.
>>> counter = AtomicCounter()
>>> counter.increment()
@QuantumGhost
QuantumGhost / example.puml
Last active September 21, 2024 19:19
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@xvitaly
xvitaly / remove_crw.cmd
Last active October 23, 2024 08:23
Remove telemetry updates for Windows 7 and 8.1
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)
@ccbrown
ccbrown / DumpHex.c
Last active October 16, 2024 07:37
Compact C Hex Dump Function w/ASCII
#include <stdio.h>
void DumpHex(const void* data, size_t size) {
char ascii[17];
size_t i, j;
ascii[16] = '\0';
for (i = 0; i < size; ++i) {
printf("%02X ", ((unsigned char*)data)[i]);
if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') {
ascii[i % 16] = ((unsigned char*)data)[i];
/*\
|*|
|*| :: cookies.js ::
|*|
|*| A complete cookies reader/writer framework with full unicode support.
|*|
|*| https://developer.mozilla.org/en-US/docs/DOM/document.cookie
|*|
|*| This framework is released under the GNU Public License, version 3 or later.
|*| http://www.gnu.org/licenses/gpl-3.0-standalone.html