Skip to content

Instantly share code, notes, and snippets.

View pcornier's full-sized avatar

Pierco pcornier

View GitHub Profile
@pcornier
pcornier / Termux.Jupyter.md
Created August 8, 2017 12:43
Install Jupyter with Numpy, SciPy, Pandas and Matplotlib
pkg install apt-transport-https curl gnupg pkg-config clang
pkg install freetype freetype-dev libpng libpng-dev libzmq-dev libzmq

mkdir $PREFIX/etc/apt/sources.list.d

echo "deb [trusted=yes] https://its-pointless.github.io/files/ termux extras" > $PREFIX/etc/apt/sources.list.d/pointless.list

curl -O https://its-pointless.github.io/pointless.gpg
@pcornier
pcornier / ground.gd
Last active March 23, 2023 15:17
Godot GDScript - An implementation of A* path finding algorithm for tilemap
extends TileMap
const WALKABLE = 2
var cells = Vector2Array()
func _ready():
cells = get_used_cells()
pass
func find_path(map_from, map_to):
@pcornier
pcornier / package.json
Last active January 11, 2023 13:41
debug simple JS file with GTKWave
{
"dependencies": {
"escodegen": "^2.0.0",
"esprima": "^4.0.1",
"estraverse": "^5.3.0",
"minimist": "^1.2.7"
}
}
@pcornier
pcornier / love&droidEdit.txt
Last active November 12, 2022 10:27
External command for DroidEdit that runs a project w/ Löve. Termux & Löve2D are required.
- project directory in /storage/emulated/0/Download/projects/...
- sshd is running in termux and storage mounted
- files are edited with DroidEdit through ssh: ~/storage/downloads/projects/...
- external Löve command:
cd ${path} && zip -r test.love * -x test.love && am start -t org.love2d.android -a android.intent.action.VIEW -d "file://${path}/test.love"
@pcornier
pcornier / info.md
Last active September 22, 2022 08:34
Quartus - Pocket - WSL2

Docker + WSL2 + VcXsrv

compile from WSL2:

docker run -it --rm -v ~/FPGA/_Pocket/core-template/src/fpga:/build raetro/quartus:pocket quartus_sh --flow compile ap_core.qpf

run Quartus GUI:

docker run -it --rm -v ~/FPGA/_Pocket/core-template/src/fpga:/build -e DISPLAY="$(netsh.exe interface ipv4 show addresses Wi-Fi | head -n 4 | grep -oP [0-9.]+)":0 raetro/quartus:pocket quartus
@pcornier
pcornier / gist:2da9976a9d5603f717e384a88ff30fd5
Last active July 13, 2022 09:30
yosys/ghdl -> verilog (VHDL to Verilog with Yosys & GHDL)
# make sure it's python 2.7
sudo update-alternatives --config python
# build ghdl
sudo apt install -y git make gnat zlib1g-dev
git clone https://github.com/ghdl/ghdl
cd ghdl
./configure --prefix=/usr/local
make
sudo make install
@pcornier
pcornier / install.md
Last active December 6, 2021 16:33
Verilator on Termux
curl -fsSL https://its-pointless.github.io/setup-pointless-repo.sh | bash -
apt install git clang binutils make autoconf flex bison python3
git clone http://git.veripool.org/git/verilator
cd verilator
autoconf
./configure --prefix=${PREFIX}
make
make install
@pcornier
pcornier / gameEngine.js
Last active November 12, 2021 13:10
A minimal Javascript game engine that has an ECS, a state manager and a global bus event system in 30 lines
const Bus = () => {
let listeners = {}
return {
register: (event, cb) => {
listeners[event] = listeners[event] || []
listeners[event].push(cb)
},
emit: (event, ...payload) => {
listeners[event].forEach(cb => cb(...payload))
}
@pcornier
pcornier / Dockerfile
Last active July 21, 2021 09:04
Dockerfile for compiling the Android version of TIC-80
FROM ubuntu:latest
WORKDIR /home/root
RUN apt update
RUN apt install git wget unzip apt-utils -y
RUN apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
@pcornier
pcornier / futoshiki.js
Last active April 19, 2021 07:48
Futoshiki
// A basic Futoshiki prototype
let size = 5 // decrease for easier games
let width = 300
let height = 300
let padding = width*0.03
let cellwidth = (width/size)-padding*2;
let cellheight = (height/size)-padding*2
let hv = 4 // vertical helpers
let hh = 4 // horizontal helpers