Skip to content

Instantly share code, notes, and snippets.

hugohil hugohil

Block or report user

Report or block hugohil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View translate.js
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, '');
View objloader.js
(function() {
var scene, camera, renderer;
var geometry, material, mesh;
init();
animate();
function init() {
scene = new THREE.Scene();
@hugohil
hugohil / yaourt.js
Last active Nov 10, 2016
Where you should eat lunch
View yaourt.js
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 Sep 30, 2015
print console log with current file name and line
View jslog.sublime-snippet
<snippet>
<content><![CDATA[console.log('$TM_FILENAME - $0');]]></content>
<tabTrigger>jslog</tabTrigger>
<scope>source.js</scope>
</snippet>
@hugohil
hugohil / i18next.js
Created Jun 26, 2015
internationalize
View i18next.js
// 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 Aug 29, 2015
Translate a crop area from a zoomed copy
View scale-crop.js
// 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];
@hugohil
hugohil / disable-right-click.js
Last active Aug 29, 2015
Disable right click
View disable-right-click.js
(function(){
var blockContextMenu, element,
blockContextMenu = function (event){
event.preventDefault();
}
element = document.body;
element.addEventListener('contextmenu', blockContextMenu);
})();
@hugohil
hugohil / close-warning.sh
Last active Aug 29, 2015
Close Chrome/Chromium warning in full screen on a full HD display
View close-warning.sh
xdotool mousemove --sync 1900 50
xdotool getactivewindow click 1
sleep 1
xdotool mousemove --sync 1900 20
xdotool getactivewindow click 1
@hugohil
hugohil / Preferences.sublime-settings
Last active Aug 29, 2015
Preferences.sublime-settings
View Preferences.sublime-settings
{
"bold_folder_labels": true,
"caret_style": "phase",
"draw_white_space": "all",
"font_size": 13,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
@hugohil
hugohil / install_computer.sh
Last active Aug 29, 2015
install_computer
View install_computer.sh
#!/bin/bash
sudo apt-get install -y apt-transport-https
sudo apt-get install -y curl
sudo apt-get install -y vim
sudo apt-get install -y vim
sudo apt-get install -y apache2
sudo apt-get install -y build-essential
sudo apt-get install -y autoconf
You can’t perform that action at this time.