Skip to content

Instantly share code, notes, and snippets.

View cwervo's full-sized avatar
🕴️

Andrés Cuervo cwervo

🕴️
View GitHub Profile
@cwervo
cwervo / README.md
Created November 8, 2023 21:23
A script for figuring out what keyboards are currently attached in Linux

Make this executable (e.g. chmod +x listKeyboards.tcl) and then ./listKeyboards.tcl

Sample output:

folk@folk0:~$ ./listKeyboards.tcl
Working ...
-- Keyboard found: /dev/input/event6 DEVPATH=/devices/pci0000:00/0000:00:01.1/0000:02:00.0/usb3/3-2/3-2:1.2/0003:046D:C52B.000C/00
03:046D:404B. 000D/input/input67/event6
-- Keyboard found: /dev/input/event7 | DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11:1.2/0003:046D:52.0006/0003:046D:404
@cwervo
cwervo / 1_pull_in_parquet.tcl
Created August 23, 2023 17:31
Folk Data Manipulation Example
set fd [file tempfile py script.py]
puts $fd {
import pandas as pd
file_path = '~/image-label/points.parquet'
df = pd.read_parquet(file_path)
json_data = df.to_json(orient='records')
print(json_data)
}; close $fd
@cwervo
cwervo / bookmarklet.js
Created November 1, 2019 19:24
Are.na Bookmarklet
javascript:(function()%7Bvar%20s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('charset','UTF-8');s.setAttribute('src','https://www.are.na/loader.js');document.documentElement.appendChild(s);%7D)()
@cwervo
cwervo / index.html
Last active October 26, 2019 10:31
testing-camernder-2019-10-26
<!DOCTYPE html>
<!-- Secondary camera projected on a screen
-->
<html>
<head>
<script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v6.0.1/dist/aframe-extras.min.js"></script>
<script src="https://rawcdn.githack.com/jgbarah/aframe-playground/e1a42e1bc745f340c572c7b4db43f7c97210ee76/camrender-01/camrender.js"></script>
</head>
@cwervo
cwervo / config.fish
Created August 27, 2019 18:26
My temporary file for my fish config (just trying it out as a shell!)
set fish_greeting "🐶🐶🐶"
# ----------------------- NOTE -------------------
# I'm also using:
# - https://github.com/jorgebucaran/fisher
# - https://github.com/FabioAntunes/fish-nvm
# - https://github.com/oh-my-fish/plugin-rvm (doesn't need omf, can download with `fisher add oh-my-fish/plugin-rvm`)
# - https://github.com/jhillyerd/plugin-git
# - https://github.com/rafaelrinaldi/pure
# I haven't automated downloading these, TODO
# -----------------------------------------------
@cwervo
cwervo / ttt.clj
Created October 18, 2018 07:07
An entry for my Recurse Center pairing interview! Note: this requires boot to run Clojure!
#!/usr/bin/env boot
;; Note: this script requires Boot to run: https://github.com/boot-clj/boot#install
(def state (atom ["1" "2" "3"
"4" "5" "6"
"7" "8" "9"]))
;; Test state
#_(def state (atom ["X" "X" "3"
"4" "X" "6"
"O" "O" "9"]))
(def current-player (atom 1))
@cwervo
cwervo / wavy-warble-shader.md
Last active October 2, 2018 23:52
A wavy, warbly fragment shader.

example gif

@cwervo
cwervo / fungi.js
Created June 27, 2018 14:46
A small three.js template to inject Emscripten into
let scene,
camera,
renderer,
cube;
function init () {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
@cwervo
cwervo / webAR-authoring-tools.md
Last active April 9, 2023 04:00
A collection of tools for creating AR content using web technologies.
@cwervo
cwervo / 10print-component.js
Created October 14, 2017 04:32
An implementation of the 10print algorithm in an A-Frame component!
AFRAME.registerComponent('10print', {
schema : {
x : { default : 0 },
y : { default : 0 },
width : { default : 30 },
height : { default : 5 },
spacing : { default : 1 },
color : { default : 'white', type : 'color'},
side: { default : 'double' }