Skip to content

Instantly share code, notes, and snippets.

View leafac's full-sized avatar

Leandro Facchinetti leafac

View GitHub Profile
slider1:mode=0<0,0,0{Send,Receive}>Mode
slider2:track.send=0<0,0,0{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128}>Track
slider3:tracks.receive=0<0,0,0{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128}>Tracks
slider4:_global.leafac_Inter_plugin_communication.blocks=1<1,10,1>Blocks
options:gmem=leafac_Inter_plu
@leafac
leafac / gist:abc9e837ba1bb6affba7d573bcbce312
Created December 29, 2021 19:11
REAPER 6.43 Stack Trace
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: REAPER [71676]
Path: /Applications/REAPER.app/Contents/MacOS/REAPER
Identifier: com.cockos.reaper
Version: 6.43.0_0e4a702u (6.43.0_0e4a702u)
Code Type: ARM-64 (Native)
Parent Process: REAPER [71667]
// ScreenWriter
#text = "alskdjf alkdfjkls fal kfs aflksafsdjkl fsdk jl jklsad kljfds
jkladfj kldfj klfd jslfasd jklfdk jlas akjlsdfs jklfd jkladf jlkfda jklafd jklfd
ajlksfdal jkfas djksdfaj klafsd jl ljafsd jlkfdasl jadfs lkjfdas lkadlfs kfs klaj
fajldks";
#font = "Arial";
//@param1:scroll_progress 'Progress' 0 0 1 0.5 0.0001
//@param3:font_size 'Font Size (px)' 40 20 250 150 4
@leafac
leafac / init.lua
Created August 25, 2021 14:54
Hammerspoon Snippets
hs.alert("Hammerspoon configuration loaded")
hs.hotkey.bind({"⌥", "⌃"}, "return", function() hs.reload() end)
hs.hotkey.bind({"⌥", "⌃"}, ",",
function() hs.execute([[code ~/.hammerspoon]], true) end)
hs.hotkey.bind({"⌥", "⌃"}, "space", function() hs.toggleConsole() end)
hs.hotkey.bind({"⌥", "⌃"}, "escape", function()
hs.osascript.applescript("beep")
hs.sound.getByName("Submarine"):play()
end)
@leafac
leafac / notes.md
Created August 25, 2021 13:26
Quirks of Client-Side Form Validation
  • ‘required’ doesn’t stop the field from being whitespace
  • ‘pattern’ isn’t checked if the field is left empty and it isn’t ‘required’
  • You can do ‘required pattern=".\S."’ if you want a quick-and-dirty solution
@leafac
leafac / notes.md
Created August 25, 2021 13:22
Notes on Timezones in Node.js & SQLite Applications
  • SQLite’s datetime functions are all UTC, but they don’t explicitly include the timezone information
  • In JavaScript (browsers & Node.js) datetimes without explicit timezone information are interpreted as local time
  • In servers (for example, DigitalOcean & GitHub Actions machines) the timezone is usually set to UTC
  • In development, the timezone is set to the user’s timezone
  • We can change the timezone for the Node.js process in macOS/Linux with the TZ=UTC environment variable
  • On Windows, the only solution is to temporarily change the OS timezone
  • This sounds too heavy-handed and storing datetimes without an explicit timezone seems like a bad idea, anyway
  • So the best solution that works everywhere is to avoid using SQLite datetime functions for generating values that will be stored in the database (it’s still fine to use them for queries)
  • To be exact, I’m talking about SQLite’s CURRENT_TIMESTAMP, datetime() and so forth
  • The correct way of doing it is using the more generic SQLite datetime function