Skip to content

Instantly share code, notes, and snippets.

View p01's full-sized avatar

Mathieu 'p01' Henri p01

View GitHub Profile
@p01
p01 / viewer_snippet.js
Last active August 29, 2015 14:01
PDF.js profile slow pages
/*
* Copy this gist into a snippet of the Sources panel of the DevTool and run it to profile slow pages
* Alternatively the PDFView.PROFILE_THRESHOLD can be set in `ms`
*/
// threshold in ms to keep/discard CPU profile
PDFView.PROFILE_THRESHOLD = 500;
PDFView.renderHighestPriority = function pdfViewRenderHighestPriority_patched(currentlyVisiblePages) {
if (PDFView.idleTimeout) {
@p01
p01 / List_of_demos.md
Last active August 29, 2015 14:09
List of demos in the Monster Audio-Visual demos in a TCP packet talk at JSConf EU 2014
@p01
p01 / index.html
Last active August 29, 2015 14:13
JS1k 2015 Invitation
<!doctype html>
<html>
<head>
<title>JS1k 2015 Invitation by Mathieu 'p01' Henri</title>
<meta charset="utf-8" />
<meta name="author" content="Mathieu 'p01' Henri, @p01"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<style>
html, body { margin: 0; padding: 0; border: 0; }
#c { display: block; } /* kill scrollbars from hell */
@p01
p01 / LICENSE.txt
Created July 30, 2011 11:27 — forked from 140bytes/LICENSE.txt
isPrimeNumber in 41 bytes
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
Created October 3, 2011 21:55 — forked from Prinzhorn/LICENSE.txt
American Soundex in 146 bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
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
Created October 6, 2011 17:11 — forked from 140bytes/LICENSE.txt
Mandelbrot fractal with zoom & panning in 133 bytes
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 / live-coding-at-SG.html
Last active November 26, 2015 22:48
Live coding at Creative Coding Singapore
<style>
#b {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(circle, #000, #123);
}
@p01
p01 / quack.js
Created January 12, 2014 16:11
Conditional breakpoint after X iterations of a loop
// 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.
@p01
p01 / index.html
Last active January 31, 2016 23:24
LIVE code at FRAMSIA - 20160127
<style>
#b {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(circle, #345, #201);
}
@p01
p01 / demo.js
Last active March 25, 2016 22:45
JS1k 2016: THE SECRET OF MENTAL ISLAND
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(_)