Skip to content

Instantly share code, notes, and snippets.

View lboulard's full-sized avatar

Laurent Boulard lboulard

  • Versailles, France
View GitHub Profile
@himanshuvirmani
himanshuvirmani / CustomProgressBar.java
Created April 11, 2014 11:01
Creating a full screen progress bar component for Android
public final class CustomProgressBar {
private Dialog dialog;
public Dialog show(Context context) {
return show(context, null);
}
public Dialog show(Context context, CharSequence title) {
return show(context, title, false);
@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@rstanleyhum
rstanleyhum / restic-windows-vss.ps1
Last active January 13, 2023 21:55
Restic Backup Windows Volume Shadow Copy Service script taken from https://github.com/restic/restic/issues/340
# Windows PowerShell Script to use restic to backup files using the Volume Shadow Copy Service, allowing
# that are in use to be backed up. The script must be run with elevated privileges.
# The Volume Shadow Copy Service must be enabled for the disk volume that contains the files to be backed up.
#
# Parameters
$resticExe = 'C:\Users\Username\go\bin\restic.exe'
$resticRepository = '\\SYNOLOGY212J\backups\restic-workstation'
$rootVolume = "C:\"
# List of folders to backup, separated by commas
$foldersToBackup = @(
@lboulard
lboulard / pip-upgrade-all-windows.md
Last active February 2, 2020 10:47
Manage python packages on windows

Upgrade all

Upgrade pip before in case of very old version on system:

py -3 -m pip install --user -U pip

Upgrade all root packages in one go (avoid generating broken dependencies between root projects):

DEL "%TMP%\pip-upgrade.txt"
FOR /F "delims==" %i IN ('py -3 -m pip list --user --not-required --format=freeze') DO @ECHO %i &gt;&gt;"%TMP%\pip-upgrade.txt"
@lboulard
lboulard / .gitattributes
Last active December 7, 2023 19:11
Silent install of multiple python versions #windows
*.bat eol=crlf
*.xml eol=crlf
@lboulard
lboulard / py-script-inside.bat
Last active April 11, 2020 12:46
Python script inside dosbatch file
0<0# : ^
'''
:: Keep a python script inside a bat file
:: Source https://stackoverflow.com/a/41651933
@SETLOCAL ENABLEEXTENSIONS
@py -3 -x -B "%~f0" %*
@SET ERR=%ERRORLEVEL%
@:: Pause if not interactive
@ECHO %cmdcmdline% | FIND /i "%~0" >NUL
@IF NOT ERRORLEVEL 1 PAUSE
@beesandbombs
beesandbombs / shiftinSquares.pde
Created February 18, 2021 17:12
shiftin’ squares
// by dave @beesandbombs
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
// by dave :)
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
// by dave @beesandbombs
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@lboulard
lboulard / README.md
Last active December 7, 2023 19:13
Fancy clink #windows #dotfiles