Skip to content

Instantly share code, notes, and snippets.

View jeromeetienne's full-sized avatar

Jerome Etienne jeromeetienne

View GitHub Profile
@jeromeetienne
jeromeetienne / consoleLogToScreen.js
Created September 25, 2014 13:55
console.log to screen - nice to debug mobile
//////////////////////////////////////////////////////////////////////////////////
// console.log to screen
//////////////////////////////////////////////////////////////////////////////////
;(function(){
var container = document.createElement('div')
container.dataset.name = 'consoleLogOnScreen'
container.style.width = '100%';
container.style.height = '100%';
container.style.position = 'absolute';
container.style.fontSize = '100%';
@jeromeetienne
jeromeetienne / README.md
Last active August 29, 2015 14:10
Description of jsdocFunction API

jsdocFunction

It ensures the jsdoc of your function is respected during execution. Check out the live demo.

API

var newFct = jsdocFunction(yourFct)
@jeromeetienne
jeromeetienne / NOTES.md
Created March 7, 2015 17:01
AR/VR Report
  • Virtual reality is about an other reality. Not like the actual reality that surround you.
  • Virtual reality is close to the scope of entertainment because it can display any reality even the fixtuous ones. Out goes from the realty displays in game. Level game. For games. Even gtav. We can imagine how the actual movie industry could use vR to display a new kind of movie
  • Augmented reality is about modifying our reality. The current works we live in. It is a way more profound change.
  • AR is more about utilities. VR is more about entertainment
  • Just trying to better understand the meaning of those words. Those concepts are very young. Their definitions is still very vague.
  • How to display it. Where is the screen for the user. Is there a single screens? Or two, one for each eye. Is it see thru display. Is it more normal opaque screen. Can user perceive depth
  • Relation between screen position and the latency issue to fool the brain
  • What reality is displayed? What is the type of content. Is it purely v
@jeromeetienne
jeromeetienne / renderloop-vendor.js
Last active August 29, 2015 14:22
Rendering Loop ala vendor.js
// array of functions for the rendering loop
var onRenderFcts = [];
// Here you add your functions to the rendering loop.
// They will be executed in-order once per requestAnimationFrame()
onRenderFcts.push(function(now, delta){
// now is the absolute time in millisecond
// delta is the delay between now and the last iteration
// put your code here.
@jeromeetienne
jeromeetienne / RafHijacker.js
Last active August 29, 2015 14:27
Overload RequestAnimationFrame to emulate a given framerate, or to hook callback pre/post every animation frames.
/**
* Hijack requestAnimationFrame. It can add preFunction or postFunction.
*
* @constructor
*/
var RafHijacker = function(){
var originalFct = requestAnimationFrame
var _this = this
this.preFunction = null
this.postFunction = null
@jeromeetienne
jeromeetienne / lossy-compression-for-json-model.js
Last active August 29, 2015 14:27
lossy compression for 3d models in json - 10min compression algo
var data = {
foobar : 1234.56789 // NOTE: see the number
}
data = JSON.parse(JSON.stringify(data, function(key, value){
if( typeof(value) !== 'number' ) return value;
// for number, keep at most 6 digits after dot
return Number( value.toFixed(6) )
}))
@jeromeetienne
jeromeetienne / dir_scan_symlinkok.rb
Created April 28, 2010 09:33
scan dir + symlink ok
#!/usr/bin/env ruby
# reccursively scan the rootdir directory
# - if a block is given, the fullpath are yielded. They are kept IIF the block return true
# - Find.find and Dir dont follow symlinks. BUT this one does
def dir_scan(rootdir, &block)
results = []
dirnames = []
Dir.entries(rootdir).each do |entry|
next if entry == "."
@jeromeetienne
jeromeetienne / template_ezmustache.rb
Created May 16, 2010 08:42
template based on mustache
#!/usr/bin/env ruby
# system of template which are based on mustache
# - http://mustache.github.com/
# - it seems serious work. Just i dont like to have more dependancies
module TemplateEzmustache
def self.patch(template, variables)
variables.each { |key, val|
template.gsub!("{{#{key}}}", val)
}
$ cat .asoundrc
pcm.!default iec958:U0xccd0x77
TO GET ARECORD (good to test if mic work)
$ arecord -fcd -Dplughw:U0xccd0x77 -vv /dev/null
- apparently this is hard to put that in the .asoundrc
TO GET OUTPUT DEVICE
$ aplay -L
@jeromeetienne
jeromeetienne / twitter to irc from maushu
Created June 10, 2010 14:48
twitter to irc from maushu
#!/usr/local/bin/node
var sys = require('sys'),
http = require('http'),
querystring = require('querystring'),
base64 = require('./lib/base64'),
Buffer = require('buffer').Buffer,
Irc = require('./vendor/IRC/lib/irc');
var twitter_auth = { user: "<YOUR_TWITTER_USERNAME>", pass: "<YOUR_TWITTER_PASSWORD>"};