Skip to content

Instantly share code, notes, and snippets.

View bertez's full-sized avatar
🏠
Working from home

Berto Yáñez bertez

🏠
Working from home
  • A Coruña
View GitHub Profile
(async function () {
const IN = "10:00";
const OUT = "18:00";
const OFFSET = 10;
const rand = (n) => n - Math.floor(Math.random() * (2 * n + 1));
const offsetHour = (h, o) => {
let [hh, mm] = h.split(":");
hh = Number(hh);
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2016,
"ecmaFeatures": {
"jsx": true,
"modules": true
}
},
"plugins": ["react", "security"],
{"version":3,"file":"style.css","sources":["style.scss","../web_modules/font-awesome/scss/font-awesome.scss","../web_modules/font-awesome/scss/_variables.scss","../web_modules/font-awesome/scss/_mixins.scss","../web_modules/font-awesome/scss/_path.scss","../web_modules/font-awesome/scss/_core.scss","../web_modules/font-awesome/scss/_larger.scss","../web_modules/font-awesome/scss/_fixed-width.scss","../web_modules/font-awesome/scss/_list.scss","../web_modules/font-awesome/scss/_bordered-pulled.scss","../web_modules/font-awesome/scss/_animated.scss","../web_modules/font-awesome/scss/_rotated-flipped.scss","../web_modules/font-awesome/scss/_stacked.scss","../web_modules/font-awesome/scss/_icons.scss","../web_modules/font-awesome/scss/_screen-reader.scss","utilities/_normalize.scss"],"sourcesContent":["\n//Fonts\n@import url('https://fonts.googleapis.com/css?family=Montserrat:400,700');\n\n//Modules\n@import '../web_modules/font-awesome/scss/font-awesome';\n@import 'utilities/normalize';\n\n//Generic\n\nbody {\n
{"version":3,"sources":["app/public/scss/style.css"],"names":["'UTF-8'","url(","'https://fonts.googleapis.com/css?family=Montserrat:400,700'","/*!\n * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome\n * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)\n */","/* FONT PATH\n * -------------------------- */","@font-face ","font-family","'FontAwesome'","src","'../fonts/fontawesome-webfont.eot?v=4.7.0'","'../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0'","format(","'embedded-opentype'","'../fonts/fontawesome-webfont.woff2?v=4.7.0'","'woff2'","'../fonts/fontawesome-webfont.woff?v=4.7.0'","'woff'","'../fonts/fontawesome-webfont.ttf?v=4.7.0'","'truetype'","'../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular'","'svg'","font-weight","normal","font-style",".fa","display","inline-block","font","14","px","/","1","FontAwesome","font-size","inherit","text-rendering","auto","-webkit-font-smoothing","antialiased","-moz-osx-font-smoothing","grayscale","/* makes th

Keybase proof

I hereby claim:

  • I am bertez on github.
  • I am bertez (https://keybase.io/bertez) on keybase.
  • I have a public key ASCPbm6hycg_RLdnfQrDfHE2-vEKycCeso93R-Y_XAsLUgo

To claim this, I am signing this object:

@bertez
bertez / parse.py
Created April 16, 2015 12:38
Download video info from vimeo channel RSS to JSON
#pip install feedparser
import feedparser
import json
import re
rss_url = 'https://vimeo.com/channels/871426/videos/rss' #your channel rss url
d = feedparser.parse(rss_url)
@bertez
bertez / gist:d37b2993545e1e883ffb
Last active August 29, 2015 14:07
Convert multiple images to gif and video using ffmpeg and imagemagick
#install tools (osx/linux)
(brew/apt-get) install ffmpeg imagemagick
# Resize and crop all images from speficic size
convert test/*.jpg -resize 640x360^ -gravity center -crop 640x360+0+0 +repage cropped/img_%05d.jpg
# Create gif
convert -delay 20 cropped/img_*.jpg todas.gif
# Bonus: create video
Install
brew install ffmpeg --with-libvorbis --with-libvpx --with-libx264 --with-fdk-aac --with-theora
General options
https://www.ffmpeg.org/ffmpeg.html
MP4
@bertez
bertez / .vimrc
Last active December 16, 2015 02:59
o meu vimrc
" Incompatible co pasado
set nocompatible
" Pathogen load
filetype off
call pathogen#infect()
call pathogen#helptags()
filetype plugin indent on
#this function is based on: http://mathforum.org/library/drmath/view/63767.html
def area_bbox(bbox, radio_planeta = 6371):
"""calculates the area in km2 of a rectangular bbox defined by two longitude and latitude points"""
import math
lon1, lat1, lon2, lat2 = bbox
#area of the earth between the first line of latitude and the north pole
a1 = 2 * math.pi * radio_planeta**2 * ( 1 - math.sin(lat1) )