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
// by dave @beesandbombs :)
float[][] result;
float t, c;
float ease(float p) {
p = c01(p);
return 3*p*p - 2*p*p*p;
}
@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
@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();
}
@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()