Skip to content

Instantly share code, notes, and snippets.

View feload's full-sized avatar

Felipe feload

View GitHub Profile
@feload
feload / mixins.scss
Last active June 23, 2017 21:59
Sass mixins
// Variables.
$small-range: (0em, 40em); /* 0, 640px */
$medium-range: (40.063em, 64em); /* 641px, 1024px */
$large-range: (64.063em, 90em); /* 1025px, 1440px */
$xlarge-range: (90.063em, 120em); /* 1441px, 1920px */
$xxlarge-range: (120.063em); /* 1921px */
@function lower-bound($range) {
@if length($range) <= 0 {
@feload
feload / bash_profile.setup
Created November 25, 2016 15:05
Terminal setup
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[36m\]\u\[\033[m\]\[\033[33;1m\]\w\[\033[m\]\[\033[32m\]\$(parse_git_branch)\[\033[00m\]$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
@feload
feload / csv-download.js
Last active January 30, 2017 18:25
This script allows you create a csv on the fly.
var A = [['n','sqrt(n)']];
for(var j=1; j<10; ++j){
A.push([j, Math.sqrt(j)]);
}
var csvRows = [];
for(var i=0, l=A.length; i<l; ++i){
csvRows.push(A[i].join(','));
@feload
feload / bumpversion.sh
Created March 16, 2017 03:13 — forked from pete-otaqui/bumpversion.sh
Bump a software project's VERSION, add the CHANGES, and tag with GIT
#!/bin/bash
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3"
# this script will display the current version, automatically
# suggest a "minor" version update, and ask for input to use
# the suggestion, or a newly entered value.
@feload
feload / Git push deployment in 7 easy steps.md
Created April 21, 2017 15:56 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@feload
feload / node-npm-in-docker.sh
Created April 21, 2017 16:03 — forked from artemgordinskiy/node-npm-in-docker.sh
Run Node/NPM in a Docker container
# For example, run "npm install"
docker run -v "$PWD":/usr/src/app -w /usr/src/app node:4 npm install
# This command creates a container (downloading one first if you don't have it locally), runs the command in a current directory and quits the container
# Great Success!
@feload
feload / DooD.txt
Created April 22, 2017 05:37
DooD
docker run -it -v /var/run/docker.sock:/var/run/docker.sock ubuntu:latest sh -c "apt-get update ; apt-get install docker.io -y ; bash"
@feload
feload / DataTableToList.cs
Created April 27, 2017 15:00
Convert DataTable to a generic list - extension method
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Web;
namespace helper
{
/// <summary>
@feload
feload / money.regexp
Created June 2, 2017 21:15
Money regexp.
'([1-9]+[0-9]?)(,)([1-9]+[0-9])(,)([\d]+)(\.)([\d]+)'|'([1-9]+[0-9]?)(,)([\d]+)(\.)([\d]+)'|'([\d]+)(.)(\.)(.)([\d]+)'
@feload
feload / round.js
Created August 22, 2017 19:37
Round JS function
function round(value, decimals) {
return Number(Math.round(value+'e'+decimals)+'e-'+decimals);
}