Skip to content

Instantly share code, notes, and snippets.

@hugohil
hugohil / procedure.md
Created September 26, 2016 10:44
Disable Oculus Home while still using the USB charger

Disable Oculus Home and use the Gear VR

TL;DR: Remove any Oculus app and enable the Gear VR Service developper mode. Do not disable Gear VR Service package.

This step-by-step guide will allow you to plug your device into the Samsung Gear VR HMD without auto-launching Oculus Home and still having the HMD buttons disabled and the USB charger active.

We came to this procedure thanks to this guide. We found some steps not necessary and missed informations so we made this one. Cheers to robamacaf !

Finally, this has been tested and worked on a Samsung Galaxy S7 / Android 6.0.1 with an Apache Cordova app. If you have tested this on another setup and it worked, please notify me and I'll update this guide.

@hugohil
hugohil / base-API-definition.yaml
Created September 21, 2016 21:54
Base swagger API definition
swagger: '2.0'
info:
version: '1.0.0'
title: My API
description: A sample API to start hacking with swagger
contact:
name: John Doe
email: johndoe@example.com
url: http://example.com
license:

Keybase proof

I hereby claim:

  • I am hugohil on github.
  • I am hugohil (https://keybase.io/hugohil) on keybase.
  • I have a public key ASBwwZzPOfuoj-1vMnYzCTYL4uKPpbF4-jioD3N0Ac29LAo

To claim this, I am signing this object:

@hugohil
hugohil / server.py
Created June 28, 2016 12:55
Basic python 2.7 REST API
#!/usr/bin/python
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
PORT_NUMBER = 8080
PUBLIC_ENTRY = './public/index.html'
# This class will handles any incoming request
class handleRoutes(BaseHTTPRequestHandler):
# Handler for the GET requests
def do_GET(self):
i18n.init({ lng: 'en-EN', load: 'current', fallbackLng: false }, function(t) {
var keys = document.querySelectorAll('[data-i18n]');
for (var i = 0; i < keys.length; i++) {
var key = keys[i].dataset.i18n;
var attribute = null;
var attributeRegEx = new RegExp(/\[(\S*)\]/);
if(key.match(attributeRegEx)){
attribute = key.match(attributeRegEx)[1];
key = key.replace(attributeRegEx, '');
@hugohil
hugohil / objloader.js
Created October 24, 2015 15:06
OBJ Loader
(function() {
var scene, camera, renderer;
var geometry, material, mesh;
init();
animate();
function init() {
scene = new THREE.Scene();
@hugohil
hugohil / yaourt.js
Last active November 10, 2016 11:52
Where you should eat lunch
var Slack = require('node-slack');
var slack = new Slack('https://hooks.slack.com/services/your/hook/key');
var places = ["Ecole", "Japonais-chinois", "Jumbo", "Lotus", "Franprix", "Castro", "Picard", "Khmer babtou", "Frères Bedri", "Bagel hipster", "Flesh"];
console.log('Yaourtotron 1.0\n©Soixante circuits. Tout droits réservés.');
console.log('Les différents choix sont:');
for(var i = 0; i < places.length; i++){
console.log(' - ' + places[i]);
}
console.log('\n\nEt le résultat est:');
@hugohil
hugohil / jslog.sublime-snippet
Last active September 30, 2015 08:05
print console log with current file name and line
<snippet>
<content><![CDATA[console.log('$TM_FILENAME - $0');]]></content>
<tabTrigger>jslog</tabTrigger>
<scope>source.js</scope>
</snippet>
@hugohil
hugohil / i18next.js
Created June 26, 2015 13:25
internationalize
// You'll need to download i18n as well as jquery
// http://i18next.com/
// https://jquery.com/download/
$(document).ready(function(){
i18n.init({ lng: 'en-EN', load: 'current', fallbackLng: false }, function(t) {
$('[data-i18n]').i18n();
});
});
@hugohil
hugohil / scale-crop.js
Last active August 29, 2015 14:22
Translate a crop area from a zoomed copy
// Usage:
// node scale-crop.js infile zoom translate_x translate_y rotation outfile
'use strict';
var gm = require('gm');
var args = process.argv.slice(2);
console.log(args);
var infile = args[0];