Skip to content

Instantly share code, notes, and snippets.

View mauricionobrega's full-sized avatar
:shipit:
Focusing

Mauricio Nobrega mauricionobrega

:shipit:
Focusing
View GitHub Profile
@mauricionobrega
mauricionobrega / create-tables-locally.js
Created June 5, 2022 16:11 — forked from adieuadieu/create-tables-locally.js
Using DynamoDB Locally in a Serverless Framework Project
const fs = require('fs')
const DynamoDB = require('aws-sdk/clients/dynamodb')
const yaml = require('js-yaml')
const cloudformationSchema = require('@serverless/utils/cloudformation-schema')
const SERVERLESS_CONFIG = __dirname + '/serverless.yml'
const ddb = new DynamoDB({
accessKeyId: 'fake-key',
endpoint: 'http://localhost:8001',

Keybase proof

I hereby claim:

  • I am mauricionobrega on github.
  • I am mauricionobrega (https://keybase.io/mauricionobrega) on keybase.
  • I have a public key ASDteZ13_8cSAAWv5rIJy7cyQlvpioRkFRV5zhmGIChOtQo

To claim this, I am signing this object:

@mauricionobrega
mauricionobrega / .gitconfig
Created November 1, 2019 17:51 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
@mauricionobrega
mauricionobrega / .gitattributes
Created November 1, 2019 17:51 — forked from Voonder/.gitattributes
Sample of git config file (Example .gitconfig, .gitattributes, .gitignore)
# Auto detect text files and perform LF normalization
* text=auto
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
#!/bin/bash
# This has to be run from master
git checkout master
# Update our list of remotes
git fetch
git remote prune origin
# http://blog.baudson.de/blog/stop-and-remove-all-docker-containers-and-images
# List all containers (only IDs)
alias dockerListContainers='docker ps -aq'
# Stop all running containers
alias dockerStopContainers='docker stop $(docker ps -aq)'
# Remove all containers
alias dockerRemoveAllContainers='docker rm $(docker ps -aq)'
(function () {
'use strict';
String.prototype.normalize = function() {
var translate = {
'à':'a', 'á':'a', 'â':'a', 'ã':'a', 'ä':'a', 'å':'a', 'æ':'a', 'ç':'c', 'è':'e', 'é':'e', 'ê':'e', 'ë':'e',
'ì':'i', 'í':'i', 'î':'i', 'ï':'i', 'ð':'d', 'ñ':'n', 'ò' :'o', 'ó':'o', 'ô':'o', 'õ':'o', 'ö':'o', 'ø':'o',
'ù':'u', 'ú':'u', 'û':'u', 'ü':'u', 'ý':'y', 'þ':'b', 'ß' :'s', 'à':'a', 'á':'a', 'â':'a', 'ã':'a', 'ä':'a',
'å':'a', 'æ':'a', 'ç':'c', 'è':'e', 'é':'e', 'ê':'e', 'ë' :'e', 'ì':'i', 'í':'i', 'î':'i', 'ï':'i', 'ð':'d',
'ñ':'n', 'ò':'o', 'ó':'o', 'ô':'o', 'õ':'o', 'ö':'o', 'ø' :'o', 'ù':'u', 'ú':'u', 'û':'u', 'ý':'y', 'ý':'y',
@mauricionobrega
mauricionobrega / async.js
Created September 27, 2018 20:36 — forked from herrkessler/async.js
simple node async / await multiple requests with axios
const axios = require('axios');
const locations = ['London', 'San Francisco', 'Tokyo', 'Berlin'];
const apiURL = 'http://api.openweathermap.org/data/2.5/weather';
const token = 'xxxxx';
const logPosts = async () => {
try {
let allLocations = locations.map(town => axios(`${apiURL}?q=${town}&APPID=${token}`));
let weather = await Promise.all(allLocations);
@mauricionobrega
mauricionobrega / git-tag-delete-local-and-remote.sh
Created July 4, 2018 19:30 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function(dir, filelist) {
if( dir[dir.length-1] != '/') dir=dir.concat('/')
var fs = fs || require('fs'),
files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function(file) {
if (fs.statSync(dir + file).isDirectory()) {