Skip to content

Instantly share code, notes, and snippets.

View friday's full-sized avatar

Albin Larsson friday

  • Eyevinn Technology
  • Stockholm
  • 18:47 (UTC +02:00)
View GitHub Profile
@friday
friday / synaptics.conf
Created January 4, 2020 04:27
Synaptics conf for Mac-like touchpad
Section "InputClass"
Identifier "touchpad catchall"
Driver "synaptics"
MatchIsTouchpad "on"
Option "TapButton1" "1" # Left click on tap
Option "TapButton2" "3" # Right click on two finger tap
Option "MinSpeed" "1"
Option "MaxSpeed" "1.8"
Option "AccelFactor" "0.06"
Option "PressureMotionMaxFactor" "3"
@friday
friday / colortohex.js
Last active June 30, 2017 19:09
Convert rgb(a) colors to hexadecimal
/**
* colorToHex: Convert rgb(a) or 3-6 letters hexadecimal color code to 6 letters code, with alpha-support.
* Uses an optional background parameter to control how colors with alpha channels are converted
*
* Not supported: color names such as "red", "green" (if you want to preserve those, then modify the function)
*
* Usage examples:
* colorToHex("#3F3") -> "#33ff33"
* colorToHex("rgba(255, 0, 0, 0.5)") -> "#ff8080"
* colorToHex("rgba(255,0,0,.5)", "rgb(0,255,0)") —> "#808000"
@friday
friday / NES-gamepad.md
Last active January 1, 2016 02:39
A Pen by Albin Larsson.

NES-gamepad

NES-gamepad built with css3. No images. No javascript apart from the d-pad (which is a canvas). Test it here. Try pressing the buttons.

Supported in modern webkit or gecko-based browsers and IE9+

License.