Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am maumercado on github.
  • I am maumercado (https://keybase.io/maumercado) on keybase.
  • I have a public key ASBrTOjIh44AP-rfurXHFW02QgzL0L9RlvJ3YZCK8W1KIgo

To claim this, I am signing this object:

[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit
who = shortlog -s --
[push]
@maumercado
maumercado / VSCode_User_Settings.json
Created January 16, 2019 03:13
User Settings for VSCode
{
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.minimap.enabled": true,
"editor.fontSize": 14,
"debug.allowBreakpointsEverywhere": true,
"vim.enableNeovim": true,
"typescript.check.npmIsInstalled": false,
"files.associations": {
"*.js": "javascript",
@maumercado
maumercado / eslintrc-react.json
Last active February 24, 2019 03:40
eslint react
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jest": true,
"node": true
},
"extends": [
"plugin:react/recommended",
@maumercado
maumercado / eslintrc.json
Last active February 12, 2019 19:41
estlint rc for server side
{
"env": {
"es6": true,
"jest": true,
"node": true
},
"extends": ["eslint:recommended"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
// inside Vx level index
// files are named yyy_controller/routes/whatev.js
const fs = require("fs");
const controllers = {};
fs
.readdirSync(__dirname)
.filter(file => file !== "index.js")
.forEach(file => {
var _ = require('lodash')
Query.prototype.search = function (search_query, options) {
var query = this;
var value = null;
if (!_.isEmpty(search_query)) {
request_query = search_query;
} else {
request_query = {};
}
@maumercado
maumercado / queryBuilder.js
Last active January 16, 2019 03:11
batchinate or pagination by batches
require('rootpath')();
var mongoose = require('mongoose');
var async = require('async');
var _ = require('lodash');
var Query = mongoose.Query;
Query.prototype._batchinate = function(options, callback) {
var query = this;
var model = query.model;
@maumercado
maumercado / profile.bash
Last active October 10, 2015 03:57
bash git prompt and others
#!/bin/bash
/usr/local/bin/archey -c
export GOPATH=$HOME/code/go
export GOBIN=$HOME/code/go/bin
export RDOCOPT="--encoding=UTF-8"
export PIP_RESPECT_VIRTUALENV=true
export WORKON_HOME=$HOME/.venv
export EDITOR='subl --wait'
export LC_CTYPE="utf-8"
export PATH="$PATH:./node_modules/.bin:/usr/local/sbin:$GOPATH/bin"
@maumercado
maumercado / git_branch_prompt.sh
Last active July 2, 2020 20:42
Git branch in prompt
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
L_YELLOW="\[\033[1;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[1;34m\]"
NO_COLOUR="\[\033[0m\]"
CYAN="\[\033[0;36m\]"
PURPLE="\[\033[0;35m\]"
# Determine active Python virtualenv details.