Skip to content

Instantly share code, notes, and snippets.

View eseceve's full-sized avatar

Sebas Contreras eseceve

  • SCL
View GitHub Profile
@eseceve
eseceve / gulpfile.js
Created February 20, 2015 04:12
Gulp task to do deploy: changelog + bump + commit + tag + push (to github)
'use strict';
var $ = require('gulp-load-plugins')();
var changelog = require('conventional-changelog');
var exec = require('child_process').exec;
var fs = require('fs');
var gulp = require('gulp');
var pkg = require('../package.json');
var semver = require('semver');
@eseceve
eseceve / pre-commit
Created October 20, 2015 14:45
Git pre-commit hook to run ESlint
#!/bin/sh
STAGED_FILES=$(git diff --cached --name-only --dif-filter=ACM | grep ".jsx\{0,1\}$")
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true
@eseceve
eseceve / isMobileBrowser.js
Created June 15, 2018 00:44
Detect mobile browser
// source: https://stackoverflow.com/questions/11381673/detecting-a-mobile-browser
const isMobileBrowser = () => {
const browserUA = navigator.userAgent || navigator.vendor || window.opera
const isMobileBrowser = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(browserUA)
|| /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od
@eseceve
eseceve / poke.py
Created May 28, 2019 14:16
Poke's script
spends = {} # {'Javi':88490, 'Sebas':69376, 'Andy':63890, 'Fabian':57320}
pays = {}
gets = {}
def split(spends):
total = sum(spends.values())
integrants = len(spends.keys())
divided = total/integrants
print('Gastos: {}'.format(spends))
print('Se gasto en total: {}'.format(total))
@eseceve
eseceve / commits.md
Created November 6, 2019 14:36
Conventional Commits

Commit Message Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the Angular change log.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

@eseceve
eseceve / MarkdownComments.md
Created April 5, 2022 22:31 — forked from randallreedjr/MarkdownComments.md
How to add comments to Markdown

There are comments here but you can't see them

Below this ↓

//: (It’s a little bizarre, but it works with MacDown and Pandoc.) // # (This syntax works like a comment, and won't appear in any output.) // This syntax works like a comment, and won't appear in any output. //: # This syntax works like a comment, and won't appear in any output.