Skip to content

Instantly share code, notes, and snippets.

View alejoar's full-sized avatar

Alejo Arias alejoar

  • ScopeTwo.com
  • Madrid, Spain
View GitHub Profile
@alejoar
alejoar / singleton.js
Created September 12, 2023 09:13
Singleton
class Singleton {
constructor() {
if (Singleton._instance) {
return Singleton._instance;
}
Singleton._instance = this;
}
someFunction = () => {
console.log("I am a singleton");
@alejoar
alejoar / arcadia.py
Last active September 24, 2022 11:08
[Starlette/Fastapi] Webhook signature validation for Arcadia
import hashlib
import hmac
import time
import starlette
WEBHOOK_SIGNING_KEY = "<YOUR_WEBHOOK_SIGNING_KEY>"
SECONDS_TO_STALE = 300 # 5 minutes
select *
from crime_scene_report
where city = 'SQL City'
and date = '20180115'
and type = 'murder'
-- Security footage shows that there were 2 witnesses. The first witness lives at the last house on "Northwestern Dr". The second witness, named Annabel, lives somewhere on "Franklin Ave".
select *
from person
@alejoar
alejoar / touchegg.conf
Created February 4, 2017 11:51
Touchegg config for Ubuntu
<touchégg>
<settings>
<property name="composed_gestures_time">111</property>
</settings>
<application name="All">
<gesture type="DRAG" fingers="1" direction="ALL">
<action type="DRAG_AND_DROP">BUTTON=1</action>
</gesture>
<gesture type="DRAG" fingers="5" direction="DOWN">
<action type="SEND_KEYS">Control+Alt+Shift+Up</action>
#!/bin/bash
# Delay before starting
DELAY=10
# Sound notification to let one know when recording is about to start (and ends)
beep() {
paplay /usr/share/sounds/KDE-Im-Irc-Event.ogg &
}