Skip to content

Instantly share code, notes, and snippets.

View edgardleal's full-sized avatar
💻
working from home

Edgard Rosberg Duarte Leal edgardleal

💻
working from home
View GitHub Profile
@wallyhall
wallyhall / gist:95edfce51eb9960c44d367b63c965de7
Created June 16, 2020 14:45
Approximately real free memory on Linux
#!/bin/sh
cat /proc/meminfo | awk 'BEGIN { i=0; } { if ( /^(MemFree|Buffers|Cache): *(\d*)/ ) { i += $2 ; } } END { print i / 1024 / 1024 " GB" }'
@Gnzlt
Gnzlt / gourcevideo.sh
Created March 6, 2019 13:25
Gource video export command
#!/bin/bash
gource \
-s .03 \
-1280x720 \
--auto-skip-seconds .1 \
--multi-sampling \
--stop-at-end \
--key \
--highlight-users \
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@romuloceccon
romuloceccon / git-current-lines-by-author.sh
Last active April 30, 2018 09:58
git stats by author
git ls-files -z | xargs -0n1 git blame -e | perl -e 'while (<>) { s/^.*?<(.*?)>.*$/\1/; print $_; }' | sort -f | uniq -c | sort -n
@jaceju
jaceju / remove-docker-containers.md
Created November 30, 2015 03:32 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
@colinvh
colinvh / aws.md
Last active July 22, 2024 10:24
AWS Region Names

Alternative naming schemes for AWS regions

Purpose

The intent is to define terse, standards-supported names for AWS regions.

Schemes

@PurpleBooth
PurpleBooth / README-Template.md
Last active July 22, 2024 02:29
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@danilomiranda
danilomiranda / main.java
Created June 11, 2015 20:44
Java mudar caracteres acentuados para não acentuados
public class Main {
public static void main(String[] args) {
final String input = "Danilo Cássio Gonçalves";
System.out.println(Normalizer.normalize(input, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", ""));
}
}
@paulirish
paulirish / bling.js
Last active July 23, 2024 01:12
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@grillermo
grillermo / .vimrc
Created March 6, 2015 17:50
Ctrlp using ag the silver searcher
"" The Silver Searcher
if executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" " ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0