Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

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 / 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):

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 / 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:
@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 / Page.vue
Last active September 10, 2020 06:33
spritesheet vue component
<template>
<div id="wrapper">
<sprite :id="'sprite'"
:spritesheet="require('../assets/spritesheet.png')"
:json="require('../assets/spritesheet.json')"
:yoyo="false"
:fps="30"
ref="sprite"
></sprite>
<button @click="play">play</button>
@hugohil
hugohil / arduinoled.ino
Created December 4, 2017 10:02
arduinoled-test
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
unsigned long frame = 0;
const float pi = 3.14;
@hugohil
hugohil / index.js
Last active January 8, 2018 14:06
meyda multiple source and analyzers
/* to run:
budo index.js --live
uncomment the `source.connect(context.destination)` to hear tracks
*/
'use strict'
const Meyda = require('../../path/to/meyda') // use your local meyda installation
@hugohil
hugohil / webmidi-playground.js
Created January 24, 2018 11:23
test of webmidi
const WebMidi = require('webmidi')
const name = 'LPD8 MIDI 1'
WebMidi.enable((err) => {
err && console.warn(err)
WebMidi.inputs.forEach((input) => {
console.info(`${input.manufacturer} '${input.name}' ${input.state}`)
})
@hugohil
hugohil / convert-images-pot.sh
Created May 8, 2018 09:06
media conversion scripts
#!/bin/sh
for i in medias/*.jpg;
do name=`echo $i | cut -d'.' -f1`;
# # this one looks for the previous pot
# p2w=$(convert "$i" -format "%[fx:2^(floor(log(w)/log(2)))]" info:)
# p2h=$(convert "$i" -format "%[fx:2^(floor(log(h)/log(2)))]" info:)
# # this one looks for the next pot
# p2w=$(convert "$i" -format "%[fx:2^(ceil(log(w)/log(2)))]" info:)
# p2h=$(convert "$i" -format "%[fx:2^(ceil(log(h)/log(2)))]" info:)