Skip to content

Instantly share code, notes, and snippets.

View jesusaguilera's full-sized avatar
🏠
Working remotely

Jesús Aguilera jesusaguilera

🏠
Working remotely
  • Spain
View GitHub Profile
@jesusaguilera
jesusaguilera / vertex_starter.js
Last active March 20, 2021 06:34
Basic vertex shader
export default `
varying vec2 vUv;
void main(){
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0 );
}
`;
@jesusaguilera
jesusaguilera / fragment_starter.js
Last active March 20, 2021 06:34
Basic fragment shader
export default `
void main(void) {
gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
}
`;
@jesusaguilera
jesusaguilera / easing_functions.js
Last active November 14, 2020 08:38 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: t => t,
// accelerating from zero velocity
easeInQuad: t => t*t,
// decelerating to zero velocity
@jesusaguilera
jesusaguilera / install_ffmpeg.sh
Last active July 29, 2020 12:04
install ffmpeg.sh
brew install ffmpeg $(brew options ffmpeg | grep -vE '\s' | grep -- '--with-' | tr '\n' ' ')
// https://www.guardarcomofilms.net/index.php/breve_tutorial_de_ffmpeg?blog=4
let checkScrollUpDown = () => {
// Get current scroll position
let currentPos = window.pageYOffset || docuemnt.documentElement.scrollTop;
let lastPos = 0;
if(currentPos > lastPos){
// down scroll
}else {
// up scroll
@jesusaguilera
jesusaguilera / iterm2.md
Created February 11, 2020 20:57 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@jesusaguilera
jesusaguilera / detectWindowResize.js
Last active February 8, 2020 07:34
Detect when window resize stop
let resizeId;
$(window).resize(() => {
clearTimeout(resizeId);
resizeId = setTimeout(doneResizing, 500);
});
function doneResizing(){
console.log('resized!')
}
@jesusaguilera
jesusaguilera / EmailChecker.js
Created November 25, 2018 19:04
Javascript email checker
let checkEmail = /\w+([\.\+\-]?\w+)*@([\.\-]?\w+)+(\.\w{2,4})+$/;
console.log(checkEmail.test("a@a.a-a.com"));
this.state.dates.map( item => {
return (
<TouchableOpacity
onPress={ ()=> this.setState({activateItem : item.id}) }
style={[productDetail.date, this.state.activateItem === item.id ? {backgroundColor: settings.$tertiaryColor} : {}]}>
<Text style={[baseStyles.texts.semibold, this.state.activateItem === item.id ? {color: 'white'} : {}]}>{item.day}</Text>
<Text style={[baseStyles.texts.regularExtraSmall, this.state.activateItem === item.id ? {color: 'white'} : {}]}>{item.month}</Text>
</TouchableOpacity>
)
})
import React from 'react';
import {
View,
TouchableOpacity,
} from 'react-native';
// Styles
import {settings} from '../assets/styles/settings';
import {baseStyles} from '../assets/styles/base';