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
@filevich
filevich / golang-json-benchmark_test.go
Last active January 30, 2022 13:01
golang json slice benchmark
package main
import (
"bytes"
"encoding/json"
"fmt"
"testing"
)
/*
@filevich
filevich / sample.md
Last active October 4, 2021 01:35
REPL nodejs javascript

> .load foo.js

or

node -i -e "$(< yourScript.js)"

@filevich
filevich / git-secure-credential-store.md
Last active August 31, 2022 22:13
git secure credential store

sudo apt install libsecret-1-0 libsecret-1-dev

cd /usr/share/doc/git/contrib/credential/libsecret

sudo make

git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret

When you git clone, git fetch, git pull, or git push to a remote repository using HTTPS URLs on the command line, Git will ask for your GitHub username and password. When Git prompts you for your password, enter your personal access token (PAT).

@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
)
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 / 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)
@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"
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",
# /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"
},
@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