Skip to content

Instantly share code, notes, and snippets.

View diegobdev's full-sized avatar

Diego Borges diegobdev

View GitHub Profile
@vranystepan
vranystepan / README.md
Last active January 24, 2020 20:06
ECR push helper

AWS ECR push helper

Example

build your Docker image first

docker build -t tmp-image:latest
@MitchyBAwesome
MitchyBAwesome / script.sh
Created July 5, 2018 04:45
Bash Script to Setup Fargate Service
#!/bin/bash
ACCOUNT_ID="xxxxxxxx" && \
REGION="us-west-2" && \
REPO="go-http-server"
# Login to ecr
$(aws ecr get-login --no-include-email --region ${REGION})
@BARJ
BARJ / pre-commit.run-pytest.sh
Created April 16, 2018 03:56
pre-commit hook that runs pytest
#!/bin/sh
RED='\033[0;31m'
NC='\033[0m' # No Color
test_results=$(script -q /dev/null pipenv run python -m pytest ./test -v --tb=no)
if [ $? -eq 1 ]; then
printf "${RED}CANNOT COMMIT, PYTEST FAILED\n\nPYTEST RESULTS:\n"
echo "$test_results"
exit 1
fi
@jikamens
jikamens / download-helpscout-mailbox.py
Last active October 27, 2021 16:47
Python script for doanloding conversations, customers, and attachments from a Help Scout mailbox
#!/usr/bin/env python
"""Download conversations, customers, and attachments from a Help Scout mailbox
Written by Jonathan Kamens (jik@kamens.us).
Released into the public domain.
Email me patches if you have enhancements you'd like me to incorporate. Don't
bother emailing me bug reports or suggestions; this script does exactly what I
@joakin
joakin / git-find-me-the-fucking-deleted-file.sh
Last active September 27, 2025 02:49
finding a deleted file in a git repository
# If you don't remember the exact path/name, search the log for deleted files
git log --diff-filter=D --summary | grep delete
# Find the file you want to get from the ouput, and use the path
# Find the commits that involved that path
git log --all -- some/path/to/deleted.file
# Bring the file back to life to the current repo (sha commit of parent of commit that deleted)
git checkout shaofthecommitthatdeletedthefile^ -- some/path/to/deleted.file
@SubhashiniSundaresan
SubhashiniSundaresan / Render HTML file in ExpressJS
Created March 15, 2015 05:33
Render HTML file in ExpressJS
app.listen(3000);
console.log("Running at Port 3000");
Final words:
Right now we are resolving path in each router. You can optimize this little bit. Express have configuration variable which let’s you define static file path so that you don’t need to resolve path in every routes. Here is how to do so.
var express = require("express");
var app = express();
app.use(express.static(__dirname + '/View'));
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active August 10, 2025 11:21
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
@kitek
kitek / gist:1579117
Created January 8, 2012 17:50
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");