Skip to content

Instantly share code, notes, and snippets.

View drio's full-sized avatar
🐢
I don't know

David Rio drio

🐢
I don't know
View GitHub Profile
MERGE INTO s_qualtrics_covid_vaccine_verification_v2 d
USING
(
select
:Q2_DOCUMENT_LINK Q2_DOCUMENT_LINK,
:Q2_DOCUMENT_NAME Q2_DOCUMENT_NAME,
:Q14_DOCUMENT_LINK Q14_DOCUMENT_LINK,
:Q14_DOCUMENT_NAME Q14_DOCUMENT_NAME,
:Q15_DOCUMENT_LINK Q15_DOCUMENT_LINK,
@drio
drio / three_nextjs.tsx
Last active May 5, 2021 15:04
Three js in react with nextjs
import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'
import { useEffect, useRef } from 'react';
import * as THREE from 'three'
import OrbitControls from 'three-orbitcontrols'
export default function Home() {
const aRef = useRef<HTMLInputElement>(null)
from pyspark.sql.types import *
import pyspark.sql.functions as F
from pyspark.sql.functions import udf
from pyspark.sql import Row
from pyspark.context import SparkContext
from pyspark.sql.session import SparkSession
import csv
We can't make this file beautiful and searchable because it's too large.
shamac,building,ut
ecf7461f0a5,34,1605209044
ecf7461f0a5,34,1605212105
ecf7461f0a5,34,1604604014
ecf7461f0a5,34,1605214336
ecf7461f0a5,34,1605210618
ecf7461f0a5,34,1604606827
ecf7461f0a5,34,1605213409
ecf7461f0a5,34,1605209689
ecf7461f0a5,34,1605212486
;; Examples: https://github.com/yqrashawn/GokuRakuJoudo/blob/master/in-the-wild.md
;; Tutorial and Usage: https://github.com/yqrashawn/GokuRakuJoudo
;; ! | means mandatory
;; # | means optional
;; C | left_command
;; T | left_control
;; O | left_option
;; S | left_shift
;; F | fn
@drio
drio / alahack.lua
Last active August 14, 2022 14:54
cycle through alacritty instances in OSX via hammerspoon
--[[
This piece of hammer spoon code tries to address the issue of not being able to
switch between Alacritty instances in OSX.
Details: https://github.com/alacritty/alacritty/issues/607
To install:
1. Install hammer spoon (https://www.hammerspoon.org/)
2. Drop this file in your hammerspoon config directory:
$HOME/.hammerspoon/others/alahack.lua
{:profiles
{:Default {:default true
:sim 50 ;; simultaneous_threshold_milliseconds (def: 50)
;; keys need to be pressed within this threshold to be considered simultaneous
:delay 580 ;; to_delayed_action_delay_milliseconds (def: 500)
;; basically it means time after which the key press is count delayed
:alone 1000 ;; to_if_alone_timeout_milliseconds (def: 1000)
;; hold for 995s and single tap registered; hold for 1005s and seen as modifier
:held 600 ;; to_if_held_down_threshold_milliseconds (def: 500)
;; key is fired twice when 500 ms is elapsed (otherwise seen as a hold command)
{:profiles
{:Default {:default true
:sim 50 ;; simultaneous_threshold_milliseconds (def: 50)
;; keys need to be pressed within this threshold to be considered simultaneous
:delay 580 ;; to_delayed_action_delay_milliseconds (def: 500)
;; basically it means time after which the key press is count delayed
:alone 1000 ;; to_if_alone_timeout_milliseconds (def: 1000)
;; hold for 995s and single tap registered; hold for 1005s and seen as modifier
:held 600 ;; to_if_held_down_threshold_milliseconds (def: 500)
;; key is fired twice when 500 ms is elapsed (otherwise seen as a hold command)
import polyline from "@mapbox/polyline";
import * as turf from "@turf/turf";
const DIR_TO_ANGLE = {
N: 0,
NW: 45,
W: 90,
SW: 135,
S: 180,
SE: 225,
@drio
drio / Makefile
Last active July 3, 2020 13:51
Makefile to drive backups with borg
#
.PHONY: install init backup1 backup2 backup
PASS=XXXXXXXXXXXXXXXx
DIR_1=/Volumes/SSD-1Tb/borg-repo
# Hack because the disk dir has spaces ...
DIR_2=/Users/drio/WD/borg-repo
BACKUP_DIRS=/Users/drio/drio-dropbox \
/Users/drio/dev \