Skip to content

Instantly share code, notes, and snippets.

Avatar

Antoine M-P antoineMoPa

  • Sherbrooke, Québec, Canada
View GitHub Profile
View some-raymarching.glsl
#version 300 es
#define PI 3.14159265359
#define PI2 6.28318530718
precision highp float;
uniform float time;
uniform float iGlobalTime;
in vec2 UV;
out vec4 out_color;
uniform vec3 iResolution;
View spanish-to-spanishon.js
str.split(/[ \t\n]/).map(w => w.length > 3 ? w.substr(0,w.length-2) + 'on' : w).join(' ')
@antoineMoPa
antoineMoPa / find-node-project-root.elisp
Created Aug 7, 2021
Find node project root (first parent folder with a package.json)
View find-node-project-root.elisp
(defun get-node-project-dir ()
"Find first parent folder with package.json"
(setq project_dir ".")
(while (and
(not (eq nil project_dir))
(not (string= project_dir "/"))
(eq nil (member "package.json" (directory-files project_dir)))
)
(setq project_dir (expand-file-name (concat project_dir "/.."))))
@antoineMoPa
antoineMoPa / .bashrc
Created Mar 6, 2021
.bashrc part to create the "e" alias that opens a file in your current emacs (if none, starts emacs)
View .bashrc
emacsclient_and_start_emacs_if_needed () {
if [ -z `pgrep emacs` ]
then
nohup emacs &
sleep 1
fi
emacsclient -n $1
}
alias e="emacsclient_and_start_emacs_if_needed"
View bad-interior-mapping.glsl
#version 130
// Some dead code for future reference.
uniform samplerCube p3d_Texture0;
uniform float time;
uniform vec3 camera_position;
// Input from vertex shader
in vec2 texcoord;
View plane-line-intersection.glsl
/*
Copyright 2021 Antoine Morin-Paulhus
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@antoineMoPa
antoineMoPa / .emacs
Created Jan 9, 2021
Part of my .emacs
View .emacs
(setq make-backup-files nil)
(menu-bar-mode 0)
(tool-bar-mode 0)
(delete-selection-mode)
(defun beforesave ()
"deletes trailing spaces"
(delete-trailing-whitespace)
)
(add-hook 'before-save-hook #'beforesave)
(setq ring-bell-function 'ignore)
@antoineMoPa
antoineMoPa / stardelbrot.glsl
Created Dec 7, 2020
texture based on Mandelbrot (Procedural starry sky?)
View stardelbrot.glsl
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
document, body, html{
font-family: sans-serif;
padding:0;
margin:0;
max-height:100%;
View Emacs-e.md

Emacs-E - the idea :

Quickly open any file in my already opened emacs

Emacs config

Tell emacs to be a server in your .emacs:

(server-mode)
View nice-fractals.glsl
vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + vec2(-0.2, -0.7* z.y) // Mandeltree?