Skip to content

Instantly share code, notes, and snippets.

View gre's full-sized avatar
3 cups required

@greweb gre

3 cups required
View GitHub Profile
@gre
gre / main.js
Last active December 17, 2015 00:19
animated header of my blog
(function(){
if(!document.createElement('canvas').getContext) return; // canvas is required.
var requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
@gre
gre / LICENSE.txt
Last active December 14, 2015 09:28 — forked from zxamplez/CODE
Convert a JPG to PNG with indexed colors (color quantization) - #PlayCLI and #imagemagick
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2013 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
@gre
gre / LICENSE.txt
Last active December 14, 2015 09:19 — forked from zxamplez/CODE
Provides a #JSON implicit converter for java.awt.Color with #playJson.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2013 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
@gre
gre / LICENSE.txt
Last active December 14, 2015 09:19 — forked from zxamplez/CODE
Download an #OGG stream, add an echo effect, stream it again with #PlayCLI and #Iteratees .
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2013 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
@gre
gre / LICENSE.txt
Last active December 14, 2015 09:19 — forked from zxamplez/CODE
retrieve, process and re-encode a video with #PlayCLI and #Iteratees .
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2013 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
@gre
gre / code
Created March 1, 2013 09:58
toto
test
@gre
gre / balls.html
Created February 18, 2013 10:03
Made for a tutorial video: http://blog.greweb.fr/?p=2163
<!DOCTYPE html>
<canvas id="game" width="600" height="400"></canvas>
<script id="fragment" type="x-shader/x-fragment">
precision mediump float;
uniform vec2 resolution;
uniform float time;
struct Ball {
@gre
gre / gist:4744775
Created February 9, 2013 10:19
Convert all *.wav in .mp3 and .ogg (useful for HTML5 audio support on all browsers...)
for f in *.wav; do sox $f ${f%%.wav}.mp3; sox $f ${f%%.wav}.ogg; done
@gre
gre / Makefile
Created February 4, 2013 20:06
Tiny Makefile to build your Javascript libraries with Closure Compiler minification via Cloud. ( see also http://blog.greweb.fr/?p=1713 )
LIB=myLib.min.js
all: $(LIB)
%.min.js: %.js
@curl -d compilation_level=SIMPLE_OPTIMIZATIONS -d output_format=text -d output_info=compiled_code --data-urlencode "js_code@$<" http://closure-compiler.appspot.com/compile > $@
clean:
@rm $(LIB)
/**
* Imagine a web server storing tweet_id reference as Long.
* For instance, 289455363407884288L
* Now, let's say I send it to javascript as JS number:
*/
var myWebserviceResponse = { tweetId: 289455363407884288 /*, ...*/ };
doSomethingWith(myWebserviceResponse.tweetId);
// ...
console.log("https://twitter.com/greweb/status/"+289455363407884288)
// <- You have just missed my tweet!