Skip to content

Instantly share code, notes, and snippets.

View filevich's full-sized avatar
🥜
deez nuts

JP Filevich filevich

🥜
deez nuts
View GitHub Profile
// for :
// by keys
for (String i : capitalCities.keySet()) {
System.out.println("key: " + i + " value: " + capitalCities.get(i));
}
#!/bin/bash
# give it executable permission
# `chmod +x filename.sh`
echo "Total arguments : $#"
echo "1st Argument = $1"
echo "2nd argument = $2"
cat file.txt | tail -n 1 | bash -
@filevich
filevich / run command in background & survive terminal close.txt
Created November 9, 2019 23:17
run command in background & survive terminal close
# from: https://unix.stackexchange.com/questions/4004/how-can-i-run-a-command-which-will-survive-terminal-close
$ your-command-here &
$ disown
# /home/juan/.config/Code/User/settings.json
{
"workbench.startupEditor": "newUntitledFile",
"telemetry.enableTelemetry": false,
"telemetry.enableCrashReporter": false,
"editor.minimap.enabled": false,
"editor.rulers": [80],
"workbench.colorCustomizations": {
"editorRuler.foreground": "#ff4081"
},
import subprocess
import sys
links = [
# "http://openfing-video.fing.edu.uy/media/agpi/agpi_01.webm",
# "http://openfing-video.fing.edu.uy/media/agpi/agpi_02.webm",
# "http://openfing-video.fing.edu.uy/media/agpi/agpi_03.webm",
# "http://openfing-video.fing.edu.uy/media/agpi/agpi_04.webm",
# "http://openfing-video.fing.edu.uy/media/agpi/agpi_05.webm",
# "http://openfing-video.fing.edu.uy/media/agpi/agpi_06.webm",
@filevich
filevich / sdl 1.25 on linux
Last active April 16, 2020 10:16
got sdl 1.25 working on fucking linux, compiling from x64 to x86
`sudo dpkg --add-architecture i386`
`sudo apt-get update`
`sudo apt-get install libsdl1.2-dev:i386`
`sudo apt-get install gcc-multilib g++-multilib`
`g++ main.cpp -w -lSDL -lSDLmain -m32 -lGL -lGLU -I/usr/include/SDL -L/usr/lib/i386-linux-gnu -o main.o`
`./main.o`
main.cpp
````
#include "SDL.h"
@filevich
filevich / python_pools.py
Created May 20, 2020 05:16
python pools example
# https://www.geeksforgeeks.org/python-map-function/
import time
def foo(bar):
time.sleep(2)
return 'foo ' + str(bar)
from multiprocessing.pool import ThreadPool
pool = ThreadPool(processes=4)
proj #commits LOCs
================================================
tprog 666 21,729
truco 343 10,612
truco-cli-web 104 1,901
truco-srv-cli 46 1,532
truquito-vue 128 ?
truquito-web 17 ?
truquito-api 32 ?
truquito-db 9 ?
@filevich
filevich / driver.py
Last active May 28, 2021 06:08
python driver and go stub; execute Go from Python
import subprocess
cmd = ['./stub']
proc = subprocess.Popen(
cmd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)