Skip to content

Instantly share code, notes, and snippets.

View mig82's full-sized avatar
🏠
Working from home

Miguelángel Fernández mig82

🏠
Working from home
View GitHub Profile
@mig82
mig82 / portfinders.zsh
Created December 15, 2021 18:39 — forked from evanscottgray/portfinders.zsh
put this in your $shellrc and enjoy
# Find ALL the port users. _o/
findbyport() {
lsof -nP | grep ":$@" | awk '{print "Program: " $1 "\n" "PID: "$2 "\n" "User: " $3 "\n" "Address: "$9 "\n" "Action: " $10}'
}
portsinuse() {
lsof -nP | grep "IPv" | while read line; do echo $line | awk '{print "Program: " $1 "\n" "PID: "$2 "\n" "User: " $3 "\n" "Address: "$9 "\n" "Action: " $10}'; echo; done;
}
@mig82
mig82 / gitignore-cached.sh
Last active April 17, 2018 14:37 — forked from ainsofs/gist:2b80771a5582b7528d9e
Clear .gitignore cache
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
@mig82
mig82 / build.gradle
Created February 22, 2018 10:25 — forked from ocus/build.gradle
Android Library Project - Copy AAR from build/outputs/aar/PROJECT-VARIANT.aar to build/PROJECT-VARIANT-VERSION_NAME.aar after each assembleVARIANT task
android.libraryVariants.all { variant ->
def variantName = variant.name.capitalize()
def copyTaskName = "copy${variantName}Artifacts"
def assembleTaskName = "assemble${variantName}"
task(copyTaskName, type: Copy, dependsOn: assembleTaskName, group: "build") {
variant.outputs.each { output ->
def newOutputName = output.outputFile.name.replace(".aar", "-" + android.defaultConfig.versionName + ".aar")
from(output.outputFile.parent) {
include output.outputFile.name
rename output.outputFile.name, newOutputName