Skip to content

Instantly share code, notes, and snippets.

:octocat:
open sourcing when not too busy

Adrien Gibrat adriengibrat

:octocat:
open sourcing when not too busy
Block or report user

Report or block adriengibrat

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
@adriengibrat
adriengibrat / skiff.armbian9.next.log
Last active Feb 15, 2018
Skiff odroid ux4 compile error
View skiff.armbian9.next.log
>>> skeleton-init-common Fixing libtool files
>>> skeleton-init-common Installing to target
rsync -a --ignore-times --exclude .svn --exclude .git --exclude .hg --exclude .bzr --exclude CVS --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' system/skeleton/ /media/myCloudDrive/SkiffOS/workspaces/default/target/
/usr/bin/install -d -m 0755 /media/myCloudDrive/SkiffOS/workspaces/default/target/bin
/usr/bin/install -d -m 0755 /media/myCloudDrive/SkiffOS/workspaces/default/target/sbin
/usr/bin/install -d -m 0755 /media/myCloudDrive/SkiffOS/workspaces/default/target/lib
ln -snf lib /media/myCloudDrive/SkiffOS/workspaces/default/target/lib32
ln -snf lib /media/myCloudDrive/SkiffOS/workspaces/default/target/usr/lib32
/usr/bin/install -m 0644 support/misc/target-dir-warning.txt /media/myCloudDrive/SkiffOS/workspaces/default/target/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
>>> skeleton-init-sysv Extracting
@adriengibrat
adriengibrat / messageformat.js
Last active Jul 20, 2016
messageformat with format & debug
View messageformat.js
var mf = (function () {
'use strict';
function warn () {
/* eslint no-console: off, prefer-spread: off */
console.warn.apply(console, arguments)
}
function error (message) {
/* eslint no-var: off */
@adriengibrat
adriengibrat / uuid.js
Created Jul 5, 2016
simple uuid generator for evergreen browsers
View uuid.js
// see https://tools.ietf.org/html/rfc4122#section-4.4
function uuid () {
var seeds = random(12)
// inspired by https://github.com/broofa/node-uuid/blob/v2.0.0/uuid.js#L362
seeds[5] = (seeds[5] & 0x0fff) | 0x4000 // version bits
seeds[7] = (seeds[7] & 0x3fff) | 0x8000 // clock_seq_hi_and_reserved bits
return 'xx-x-x-x-xxx'.replace(/x/g, function (x, index) { return hex(seeds[index]) })
function random (n) { // get n random 16-bit unsigned integers
@adriengibrat
adriengibrat / plural.js
Last active May 30, 2017
simple CLDR plural rules parser
View plural.js
#!/usr/bin/env node
/**
* plural.js – simple CLDR plural rules parser
* https://gist.github.com/adriengibrat/817140a89cfd4893b4155a2ac913904d
*
* This program is free software. It comes without any warranty.
* Released under the WTFPL license – http://www.wtfpl.net
*
* Usage:
@adriengibrat
adriengibrat / bower.json
Last active Jul 4, 2019
Parse ISO 8601 duration as function that sums duration to a given date
View bower.json
{
"name": "parseDuration",
"version": "0.0.1",
"main": "./parseDuration.es5.js"
}
@adriengibrat
adriengibrat / how to
Last active Aug 29, 2015 — forked from albi90/how to
Compiling node-webkit on raspberry pi
View how to
cd ~
mkdir .gyp
nano .gyp/include.gypi
paste the following
{
'variables': {
'linux_use_gold_binary' : 0,
'linux_use_gold_flags' : 0,
'target_arch': 'arm',
'disable_nacl': 1, # NaCL does not build for ARM.
@adriengibrat
adriengibrat / jquery.triggerBut.demo.js
Last active Aug 29, 2015
[Hack] jQuery2 method: trigger event handlers but the ones with given namespace
View jquery.triggerBut.demo.js
(function( $ ) {
var d = $(document),
log = function (event) { d.on(event, function(e) { console.log(event, e.type, e.namespace, e.namespace_re) }) }
log("test")
log("test.a")
log("test.b")
log("test.b.a")
log("test.c")
@adriengibrat
adriengibrat / Object.prototype.watch.js
Last active Nov 28, 2018
Object.prototype.watch "polyfill"
View Object.prototype.watch.js
/**
* Object.prototype.watch polyfill
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/watch
*
* Known limitations:
* - `delete object[property]` will remove the watchpoint
*
* Based on Eli Grey gist https://gist.github.com/eligrey/384583
* Impovements based on Xose Lluis gist https://gist.github.com/XoseLluis/4750176
* This version is optimized for minification
@adriengibrat
adriengibrat / jsonp.js
Last active Aug 29, 2015
Lightweight standalone jsonP utility (jQuery like)
View jsonp.js
window.jsonP = function ( url, callback, paramName ) {
var self = arguments.callee // this function
, queue = self.queue || ( self.queue = {} ) // callback queue
, name = 'jsonP' + Object.keys( queue ).length + '_' + Date.now() // unique callback name
, global = 'jsonP.queue.' + name // global callback name
, placeholder = /(=)\?(?=&|$)/ // placeholder pattern
, script = document.createElement( 'script' ) // script dom node
;
script.type = 'text/javascript';
script.src = placeholder.test( url ) ?
@adriengibrat
adriengibrat / jquery.toascii.js
Last active Dec 17, 2015
Clean up diatrics from strings (convert to ascii)
View jquery.toascii.js
(function($){
$.toAscii = $.extend(
function toAscii (string) {
$.each(toAscii.diacritics, function(){
string = string.replace(this[1], this[0]);
});
return string;
}, {
diacritics: [
['A', /[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g],
You can’t perform that action at this time.