Skip to content

Instantly share code, notes, and snippets.

View y-lohse's full-sized avatar

Yannick Lohse y-lohse

View GitHub Profile
### Keybase proof
I hereby claim:
* I am y-lohse on github.
* I am ylohse (https://keybase.io/ylohse) on keybase.
* I have a public key whose fingerprint is 67E8 2137 9D8E 902B 861C 1B8C A538 4746 97F5 1DE9
To claim this, I am signing this object:
@y-lohse
y-lohse / README.md
Last active August 29, 2015 14:14
Android Lollipop Timetpicker

Recreating the android timepicker in scss android timepicker. Note that the android clock has PM hours on the outside circle except for 00.

Problems with current solution:

  • very heavy code
  • fixed width and height

Not sure any of the problems can be fixed, I think it somewhat pushes the limit of what scss should do :)

@y-lohse
y-lohse / slip.js
Created October 2, 2014 12:27
Slip fork with multiple list
/*
Slip - swiping and reordering in lists of elements on touch screens, no fuss.
Fires these events on list elements:
• slip:swipe
When swipe has been done and user has lifted finger off the screen.
If you execute event.preventDefault() the element will be animated back to original position.
Otherwise it will be animated off the list and set to display:none.
@y-lohse
y-lohse / raycasting.html
Last active December 10, 2015 16:39
Lighting simulation inside a canvas Built with Cannon: https://github.com/y-lohse/Cannon
<html>
<head>
<title>RayCaster</title>
<script src="http://code.yannick-lohse.fr/cannon/1/cannon.js"></script>
<script src="raycasting.js"></script>
</head>
<body>
<div>
Torch Power
<input type="range" min="0" max="200" value="80" oninput="torch_power=value;torchlight.size=value;" />
@y-lohse
y-lohse / engine-debug.js
Created January 3, 2013 21:45
A little experiment in which a couple of circles roam around a canvas behaving like in outerspace. You can find my blog article explaining more about it here: http://yannick-lohse.fr/2012/09/planetarium/ This experiment is based on my canvas framework https://github.com/y-lohse/Cannon
Cannon.include('lib/math.js');
Cannon.include('lib/display.js');
Cannon.include('lib/misc.js');
var canvas,
creating = null,
planets = [],
CONSTANT = 30,
tilemap,
NB_PLANET = 20,
@y-lohse
y-lohse / game.js
Created January 2, 2013 22:59
HTML5 pool game using the canvas and my Cannon framework : https://github.com/y-lohse/Cannon
Cannon.include('lib/math.js');
Cannon.include('lib/display.js');
Cannon.include('lib/misc.js');
Cannon.include('lib/SAT.js');
var canvas, cue;
var shooting = false, shootStart;
var rails = [], balls = [], pockets = [];
var WALL_SIZE = 10, BALL_SIZE = 10, POCKET_SIZE = BALL_SIZE*1.7;
@y-lohse
y-lohse / cross browser video stream
Created January 2, 2013 11:24
A cross-browser way to start a video stream. Here the video element is created and appended to the DOM, but you could as well use a pre-existing video element.
function getVideo(){
var videoElement = document.createElement('video');
document.body.appendChild(videoElement);
var getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia || navigator.msGetUserMedia;
var params = [
{video: true},
function(stream){
try{
videoElement.src = window.URL.createObjectURL(stream);