Skip to content

Instantly share code, notes, and snippets.

View lboulard's full-sized avatar
💭
Be patient. I enjoy real world.

Laurent Boulard lboulard

💭
Be patient. I enjoy real world.
  • Versailles, France
View GitHub Profile
@christianselig
christianselig / hammerspoon.lua
Created August 28, 2024 17:08
Add middle-button panning support to Sketch to match Figma, Fusion 360, etc.
-- Make Sketch use the middle mouse button for dragging like Figma, Fusion 360, etc.
local middleMouseDown = false
-- Function to handle the middle mouse down event
local function middleMouseDownHandler(event)
if event:getType() == hs.eventtap.event.types.otherMouseDown then
if event:getProperty(hs.eventtap.event.properties['mouseEventButtonNumber']) == 2 then
middleMouseDown = true
-- Simulate holding down the space bar
hs.eventtap.event.newKeyEvent(hs.keycodes.map['space'], true):post()
@drzony
drzony / ddc_control.cpp
Created August 31, 2023 22:23
NVAPI DDC code
class DDCControl
{
public:
DDCControl()
: _gpu_handle(NULL)
, _display_id(0)
{
initNv();
}
@JoelQ
JoelQ / tree_enumerator.rb
Created August 21, 2022 22:15
Demonstration of how using `Enumerator` makes it nicer to work with a data structure that has multiple valid traversals such as a binary tree
class Tree
attr_reader :val, :left, :right
def self.empty
EmptyTree.new
end
def self.leaf(val)
new(val, empty, empty)
end
// by dave @beesandbombs :)
float[][] result;
float t, c;
float ease(float p) {
p = c01(p);
return 3*p*p - 2*p*p*p;
}
@lboulard
lboulard / README.md
Last active December 7, 2023 19:13
Fancy clink #windows #dotfiles
// 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) {
@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) {
@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
@lboulard
lboulard / .gitattributes
Last active February 16, 2025 12:46
Silent install of multiple python versions #windows #pythin #silent #installation
*.bat eol=crlf
*.xml eol=crlf