Skip to content

Instantly share code, notes, and snippets.

View angel-rs's full-sized avatar
🎯
Focusing

Angel Rodríguez angel-rs

🎯
Focusing
View GitHub Profile
#!/bin/sh
prefix=$(echo "$1" | tr '[:upper:]' '[:lower:]')
run_command_on_panel () {
local workspace_name=$1
local command_to_run=$2
local panel_number="${3:0}"
tmux send-keys -t $workspace_name.$panel_number "$command_to_run" ENTER
}
@angel-rs
angel-rs / dev_c_file.md
Created July 5, 2020 21:57
Run a c file program on every file save
  • create your "x.c" file
  • create "run.sh" file with the following:
# run for the first time
gcc x.c
./a.out


inotifywait -q -m -e close_write examen.c |
@angel-rs
angel-rs / Answer Teacher Evaluation.js
Last active July 31, 2021 14:30
Fill college annoying pools
// this is meant to be run inside the browser
// score: 1 | 2 | 3 | 4 | 5 | 6 | 7
// difficulty: 1 | 2 | 3 | 4
function answerTeacherEvaluation(score, difficulty) {
([...document.querySelectorAll(`input[value$="${difficulty}"]`)].forEach(x => x.click())); // set difficulty
([...document.querySelectorAll(`input[value$="${score}"]`)].forEach(x => x.click())); // set score
}
// example call
@angel-rs
angel-rs / filter.v
Last active January 8, 2020 17:22
Cassidoo's Interview Question #2 - Filter in Vlang
fn basic_filter(input []int, operation fn(int) bool) []int {
mut output := []int
for value in input {
if operation(value) {
output << value
}
}
return output
}
@angel-rs
angel-rs / dateOffset.js
Created December 4, 2019 16:36
cassidoo's interview question #1
// first solution "pretty"
const days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
const dateOffset = (_day, _offset) => {
const day = days.indexOf(_day);
const offset = _offset % 7;
const sum = day + offset;
if ((day + offset) > days.length) {
return dateOffset(days[day], (day + offset) - days.length);
} else {
@angel-rs
angel-rs / MyCustomAtomShortcuts
Last active January 30, 2019 22:09
Atom shortcuts
Category Key Combination Description
Positioning:
Alt + ⭡ Jump to beginning of previous paragraph
Alt + ⭣ Jump to beginning of next paragraph
Alt + ⭠ Jump to beginning of previous word
Alt + ⭢ Jump to beginning of next word
Ctrl + Home Jump to the beginning of the document
Ctrl + End Jump to end of the document