Skip to content

Instantly share code, notes, and snippets.

Mathieu 'p01' Henri p01

Block or report user

Report or block p01

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@p01
p01 / prodScreenshot.user.js
Created Aug 24, 2012
pouet.net.user.js - prodScreenshot.user.js
View prodScreenshot.user.js
// ==UserScript==
// @name prodScreenshot
// @description Add the corresponding thumbnail inside each link to a prod.
// @include http://pouet.net/*
// @exclude http://pouet.net/
// @exclude http://pouet.net/index.php*
// @include http://www.pouet.net/*
// @exclude http://www.pouet.net/
// @exclude http://www.pouet.net/index.php*
// ==/UserScript==
@p01
p01 / LICENSE.txt
Created Oct 13, 2011 — forked from 140bytes/LICENSE.txt
Music SoftSynth
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@p01
p01 / LICENSE.txt
Last active Feb 9, 2019 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@p01
p01 / example.js
Created Jun 2, 2011 — forked from stdclass/example.js
Make RGB Colors Lighter / Darker
View example.js
/*
* Make RGB-Colors lighter / darker
*/
var color = function(c,n,i,d){for(i=3;i--;c[i]=d<0?0:d>255?255:d|0)d=c[i]+n;return c}
/**
* @param array RGB Colors
* @param number Amount
*/
@p01
p01 / index.html
Last active Sep 26, 2018
Face detection in 280 bytes
View index.html
<canvas id=a><video id=v><svg onload="navigator.getUserMedia({video:1},n=m=>{v.src=top.URL.createObjectURL(m);setInterval(async(c=a.getContext`2d`)=>{c.drawImage(v,0,0,208,150);for(i of await new FaceDetector().detect(a))with(i.boundingBox)c.strokeRect(x,y,width,height)},9)},n)">
@p01
p01 / LICENSE.txt
Created Aug 5, 2011 — forked from 140bytes/LICENSE.txt
Levenshtein Distance
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri <http://www.p01.org/releases/>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@p01
p01 / dirty_trigo.js
Last active Nov 6, 2016
Find approximation of trigonometric value
View dirty_trigo.js
onchange = function(e) {
try {
var value = eval(expression.value);
var TWO_PI = Math.PI * 2;
var minError = TWO_PI;
var results = [];
for(var i=0; i < 1e4; i++) {
var error = Math.abs(value - (i % TWO_PI));
if (error < minError) {
@p01
p01 / demo.js
Last active Mar 25, 2016
JS1k 2016: THE SECRET OF MENTAL ISLAND
View demo.js
for(_='024z),v33$22:atQon!,4GddKKKJ99@@bbJK?rocess>ect(`qq_kk^0,Z37YllX^^^WmlkmXXWVhhU5511mm☁",ff77rrrqomq__(n[parseInt("c.fiX,Text("Z:0)cc*MQh.sin(x/,1,c.globalAlpha=,R`Zxz,aaoo ii Klo@ @ Style="#K"[0|s%264],35)]*s&1) orqo ,c.f!t="pppppx serif"x+=Y)n=[35,YG1G6G9,,58,62,65,73,82,93,98101723313947658596,:Z2$,247,262,2,294,$ZY0],A=new AudioC!text,C=A.creQeScriptP>or(a.width=1zvs=ZC.c!n`A.destinQi!vC.!audiop>=functi!(l){for(b=l.outputBuer.getChannelDQa(x=0va.height=YZ214"Y0v46f".1162:740Y:054,002",x=0;x<1z;x++,s+=6.25/A.sampleRQe)R`x,$0+MQh.min(27)+4vb[x]=JV oqssss_q o VWWW^ lkjl ^ Xmsmsrs_ WU tt_qrorXXXXXXXjjUUUUfh+fi Kjo KJ@ 66enK@bb$bbfidg44cf4444cf@ jjfi@Jfk@dh?44dk00:$88ggbb@@@@@97?J UK-1),Y0);B4B"16THE SECRET OF"G8Z98)62MENTAL"G2050)ISLAND"G8096)}';G=/[-U-Z^-`>-@JKG!Q:$vz]/.exec(_);)with(_.split(G))_=join(shift());eval(_)
@p01
p01 / index.html
Last active Jan 31, 2016
LIVE code at FRAMSIA - 20160127
View index.html
<style>
#b {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(circle, #345, #201);
}
@p01
p01 / quack.js
Created Jan 12, 2014
Conditional breakpoint after X iterations of a loop
View quack.js
// Example of conditional breakpoint ( in code ) after X iterations
for(var i=0, __iterations_left_before_break=50; (--__iterations_left_before_break||debugger),i<1e5;i++)
{
// body of the loop
}
/*
To do the same in devtool, you can put a breakpoint on the first statement of the loop,
right-click on the breakpoint > Edit condition.
You can’t perform that action at this time.