Skip to content

Instantly share code, notes, and snippets.

View Naereen's full-sized avatar
📝
Coder in long holidays - full time teacher

Lilian Besson Naereen

📝
Coder in long holidays - full time teacher
View GitHub Profile
@Naereen
Naereen / fireworks.js
Created July 15, 2017 12:06
Add fireworks effects (from anime.js) to a reveal.js slideshow
// Source https://codepen.io/juliangarnier/pen/gmOwJX
// (C) Julian Garnier
// Adapted by Lilian Besson (Naereen) https://github.com/Naereen
// to add a fireworks effect on a reveal.js slideshows
var canvasEl = document.querySelector('.fireworks');
var ctx = canvasEl.getContext('2d');
var numberOfParticules = 40;
var pointerX = 0;
var pointerY = 0;
@Naereen
Naereen / Kaamelott-Soundboard.desktop
Created July 2, 2017 09:55
XDG Desktop file for a locally installed desktop app version of the website http://kaamelott-soundboard.2ec0b4.fr/
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Kaamelott Soundbard
Comment=Kaamelott Soundbard desktop app
Exec=/home/lilian/.local/kaamelott-soundboard-linux-x64/kaamelott-soundboard
Icon=/home/lilian/.local/share/applications/kaamelott-soundboard.jpg
Terminal=false
Type=Application
InitialPreference=6
@Naereen
Naereen / zelda_roth_se.desktop
Created June 12, 2017 17:01
XDG Desktop files for two Solarus games (see http://www.solarus-games.org/games/)
[Desktop Entry]
Version=1.0
Type=Application
Name=Zelda: Return of the Hylian SE
Comment=http://www.solarus-games.org/games/zelda-return-of-the-hylian-se/
TryExec=zelda_roth_se
Exec=zelda_roth_se
Icon=/usr/share/solarus/zelda_roth_se/zelda_roth_se.png
@rtoal
rtoal / JSFirst.md
Last active April 15, 2024 10:23
JSFirst

JS First

About This Manifesto

Have you ever argued for or against teaching language X as the first language in a university computer science curriculum? If so, I hope that your arguments:

  • were first and foremost about students, considering the question “What do we want students to gain from their experience with a first language?”, not “Is language X better than language Y?” because the latter question requires too much context and isn’t really answerable;
  • kept in mind that ultimately we want to train polyglots, so the first language is never the only language; and
  • took into account previous work from computing educators, and education theorists and practitioners in general.
@hediet
hediet / main.md
Last active March 11, 2024 15:05
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@Naereen
Naereen / nginx.conf
Created March 6, 2017 11:40
Configuration for NGinx to proxy uLogMe web-app (https://localhost:8443) to a folder (https://localhost/ulogme). Cf. https://GitHub.com/Naereen/uLogMe/
# Inside the SSL server:
# Local proxy for uLogMe (https://localhost:8443/)
location /ulogme/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffering off;
proxy_cache off;
proxy_ssl_verify off;
proxy_pass https://localhost:8443/;
@Naereen
Naereen / Zotero.desktop
Created February 7, 2017 14:47
Zotero.desktop file to add the standalone Zotero application to your system launcher, cf. https://www.zotero.org/
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=Zotero
GenericName=Zotero Bibliography Manager
Icon=/home/lilian/.local/Zotero_linux-x86_64/chrome/icons/default/default48.png
Exec=/home/lilian/.local/Zotero_linux-x86_64/zotero %f
Categories=Office
Terminal=false
@Naereen
Naereen / Marp.desktop
Created February 7, 2017 14:43
Marp.desktop file to add a system shortcut for Marp (https://yhatt.github.io/marp/)
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=Marp
GenericName=Marp - Markdown Presentation Editor
Icon=/home/lilian/.local/Marp/marp.png
Exec=/home/lilian/.local/Marp/Marp %f
Categories=Office
Terminal=false
Name t
Jovan 0.143522377788
Wilford 0.171813290491
Newton 0.192343843426
Maurice 0.193607112432
Emmanuel 0.20571087052
Joseph 0.210762071958
Milton 0.21296788724
Ahmad 0.214983745995
Julius 0.218052193228
@timvieira
timvieira / heap-sample.py
Created November 26, 2016 19:21
Fast sampling from an evolving distribution
import numpy as np
from numpy.random import uniform
def update(S, k, v):
"Update value position `k` in time O(log n)."
d = S.shape[0]
i = d//2 + k
S[i] = v
while i > 0: