Skip to content

Instantly share code, notes, and snippets.

View antoineMoPa's full-sized avatar

Antoine M-P antoineMoPa

  • Sherbrooke, Québec, Canada
View GitHub Profile
@jamsinclair
jamsinclair / .zshrc
Created February 16, 2021 01:40
Lazy Load NVM (node npm, npx, yarn)
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
@miguelmota
miguelmota / Makefile
Created September 3, 2018 07:21
Go (golang) WebAssembly (WASM) hello world example
compile:
GOARCH=wasm GOOS=js go build -o test.wasm main.go
copy:
cp $(go env GOROOT)/misc/wasm/wasm_exec.{html,js} .
serve:
go run server.go
# lazyload nvm
# all props goes to http://broken-by.me/lazy-load-nvm/
# grabbed from reddit @ https://www.reddit.com/r/node/comments/4tg5jg/lazy_load_nvm_for_faster_shell_start/
lazynvm() {
unset -f nvm node npm npx
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
if [ -f "$NVM_DIR/bash_completion" ]; then
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
TTTT
TTTT
TTTT
TTTT
@tsuriga
tsuriga / app.html
Last active April 23, 2024 10:18
Saving and loading files in an Electron application
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tsuri's Electron Note Sample App</title>
<link href="./app.css" rel="stylesheet" />
<script src="app.js"></script>
</head>
<body>
<h1>Welcome to note sample app!</h1>
@v0lkan
v0lkan / nginx.conf
Last active October 12, 2026 05:01
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@mbostock
mbostock / .block
Last active February 26, 2023 06:42
Hello WebGL
license: gpl-3.0
@RichardCSantana-zz
RichardCSantana-zz / gist:4022130
Created November 6, 2012 02:16
Primeiras brincadeiras em assembly(Arquitetura Mips)
.data
HelloWorld: .ascii "Hello World" #declara variavel HelloWorld como hello world
.text
main:
li $v0,4 #comando de impressão de texto na tela
la $a0, HelloWorld #coloca a variavel HelloWorld para ser impressa
syscall # efetua a chamada ao sistema
li $v0, 10 # comando de exit
@usrlocalben
usrlocalben / raymarch.php
Created September 6, 2012 23:50
raymarch in php
<?php
// oh boy, lets raymarch in php.
function LERP( $a, $b, $t ) { return (1.0-$t)*$a + $t*$b; }
function CLAMP($a,$x,$y){ return ($a<$x?$x:($a>$y?$y:$a)); }
function CLAMP01($a) { return CLAMP($a,0.0,1.0); }