Skip to content

Instantly share code, notes, and snippets.

View jaumecapdevila's full-sized avatar
:octocat:
Wubba Lubba Dub-Dub

Jaume Capdevila jaumecapdevila

:octocat:
Wubba Lubba Dub-Dub
View GitHub Profile
@jaumecapdevila
jaumecapdevila / git-util-commands
Created September 6, 2019 10:56
Util git commands
git grep <pattern> $(git rev-list --all) > report_slam.txt -- Find content matching the given pattern
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
* * * * * * * { background-color: rgba(255,0,0,.2); }
* * * * * * * * { background-color: rgba(0,255,0,.2); }
* * * * * * * * * { background-color: rgba(0,0,255,.2); }
#.SILENT: uncomment to silent all the targets
.PHONY: help
help: ## Displays available targets
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
.PHONY: clean
clean: ## Clean project
@echo "Cleaning it up!"
~r/^\S+@\S+\.\S+$/ --- basic and permissive email validation
@jaumecapdevila
jaumecapdevila / vscode-snippets.json
Last active November 28, 2017 09:56
Vscode snippets
"Test Case": {
"prefix": "test",
"body": [
"func Test$1(t *testing.T) {",
"\ttests:= []struct{",
"\t\tname string",
"\t\tinput string",
"\t\toutput string",
"\t}{",
"\t\t{name:\"$2\", input:\"$3\",output:\"$4\"},",
@jaumecapdevila
jaumecapdevila / docker_remove_containers_images.sh
Created September 27, 2017 14:36 — forked from wakumaku/docker_remove_containers_images.sh
delete all docker containers and images
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# docker rm $(docker ps --filter=status=exited --filter=status=created -q)
# Delete all images
docker rmi $(docker images -q)
# Delete untagged images
# docker rmi $(docker images -f "dangling=true" -q)
# Delete all volumes
docker volume rm $(docker volume ls -f dangling=true -q)
@jaumecapdevila
jaumecapdevila / docker_commands.sh
Created September 19, 2017 17:51
Docker commands
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# docker rm $(docker ps --filter=status=exited --filter=status=created -q)
# Delete all images
docker rmi $(docker images -q)
# Delete untagged images
# docker rmi $(docker images -f "dangling=true" -q)
# Delete all volumes
docker volume rm $(docker volume ls -f dangling=true -q)
@jaumecapdevila
jaumecapdevila / git_aliases.txt
Last active November 20, 2017 15:53
Basic git aliases
[alias]
ci = commit
st = status
co = checkout
unstage = reset HEAD --
last = log -1 HEAD
br = branch
discard = checkout --
undo = reset --hard
llog = log --date=local