Skip to content

Instantly share code, notes, and snippets.

View luruke's full-sized avatar

Luigi De Rosa luruke

View GitHub Profile
@luruke
luruke / .slate
Created April 8, 2015 15:29
my slate conf
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings
#bind right:alt resize +10% +0
#bind left:alt resize -10% +0
@luruke
luruke / README.md
Last active March 7, 2018 15:37
Looking for a new maintainer for barba.js

About two years ago I published Barba.js, a little unopinionated library for push state navigation. The library has now reached 6k stars and it's widely used by agencies and independents.

Unfortunately for different reasons I don't have much time to dedicate to the project, but at the same time it's a shame let the project die, while it's still so used from many people.

I'm looking for an active maintainer, that is already using barba.js and that can take care of the project, keep it alive and let it evolve.

Of course I can give some advice and help to keep the nature of the project consistent.

@luruke
luruke / barba_wikipedia.js
Created February 7, 2016 17:03
Add barba on wikipedia
// Barba wikipedia.org
var js = document.createElement('script');
js.type = 'text/javascript';
js.onload = initBarba;
js.src = 'https://luruke.github.io/barba.js/dist/barba.min.js';
document.body.appendChild(js);
function initBarba() {
Barba.Pjax.Dom.parseContainer = function(el) {
return el.querySelector('#content');
@luruke
luruke / ObjectPool.js
Created March 16, 2018 00:44
ObjectPool.js
export default class ObjectPool {
constructor(options = {}) {
this.options = Object.assign({
number: 10,
Create() {
return {};
},
}, options);
this.available = [];
/**
* Try to fix iOS lock on audio.
*
* By default, audio on iOS is locked until a sound is played within a user interaction,
* and then it plays normally the rest of the page session.
*/
// Inspired from https://github.com/goldfire/howler.js/blob/2.0/src/howler.core.js#L212
export default class IosUnlock {
// Button DOM
<a href="#" data-component="trackable" data-type="button">Yo, button</a>
// Trackable kapla component (https://github.com/thierrymichel/kapla)
// Using it just to track when some dom is "mounted/unmounted"
import { Component } from 'kapla';
import dom from 'gl/dom';
export default class extends Component {
init() {
import {
NearestFilter,
RepeatWrapping,
} from 'three';
import FBO from '../utils/fbo';
import textures from 'gl/utils/textures';
import trail from '../utils/trail';
import bidello from 'bidello';
const POINTS = 256;
const vertices = new Float32Array(POINTS * 4);
const ids = new Float32Array(POINTS);
for (let i = 0; i < POINTS * 4; i += 4) {
vertices[i + 0] = randomFloat(-5, 5);
vertices[i + 1] = randomFloat(-5, 5);
vertices[i + 2] = randomFloat(-5, 5);
vertices[i + 3] = randomFloat(0, 4); // random ID, for different sizes
}
this.geometry = new BufferGeometry();
this.geometry.addAttribute('position', new BufferAttribute(ids, 1));
this.material = new RawShaderMaterial({
name: 'Particles',
fragmentShader: `
precision highp float;
void main() {
gl_FragColor = vec4(0.584,0.052,0.880, 1.0);
}
this.plane = new PlaneBufferGeometry(1, 1, 1, 1);
this.viewerMaterial = new RawShaderMaterial({
blending: AdditiveBlending,
vertexShader: `
precision highp float;
uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
attribute vec2 uv;