Skip to content

Instantly share code, notes, and snippets.

View jpaulin's full-sized avatar

Jukka Paulin jpaulin

View GitHub Profile
@jpaulin
jpaulin / gist:5c349d139d26bbb5d32b81231c399cf7
Last active April 29, 2022 08:53
EDRA - edit, enable and rehash new bash aliases and settings, faster than ever!
#
# Put below lines your .bashrc or similar shell configuration file.
#
# Thus this 'installs' the edra system as part of your shell environment.
# These lines below are what matter:
#
# Uses file ~/bash_aliases (in your home folder, thus tilde ~)
# for storing aliases.
#
# When you issue 'edra', your favorite editor pops up, and you can edit & save the .rc file
@jpaulin
jpaulin / bloat-list-folders.sh
Created July 29, 2017 16:42
List any npm package folders, the wrong way: obviously bloated one (with 'cdu', the color du)
cdu -b ./node_modules/ | awk '{print $3}' | sed 's/\///g'
# We can do it this way. But let's not..
# Dependencies:
# 'cdu', the "color du"
# Compile it via sources.
# And hey, the -b switch used here for cdu actually counteracts the tool's
# main powers of existence, because -b means "do it black-and-white"
@jpaulin
jpaulin / _bash_aliases.txt
Created July 7, 2017 07:11
ffs (for file's sake)
# For file's sake: find file by string search (recursive from current folder)
alias ffs='find . -type f | grep -i $*'
# Usage:
#
# Find all files that contain the word 'android' in them
# ffs android
#
# Find all C source files from current folder and recursive under any subfolder:
# ffs '\.c$'
@jpaulin
jpaulin / fitsy.sh
Created June 28, 2017 08:12
Fitsy - search for occurrence of inline stylesheets in TypeScript based React Native code
#!/bin/bash
# TypeScript / react native tooling: "fitsy" search tool
#
# Configuration
# Set the 'lookfor' variable string to any pattern that matches the source code
# snippets you like to search for
#
# Add features
@jpaulin
jpaulin / your_bash_aliases.rc
Created June 1, 2017 06:53
Die, Android emulator (god powers)
# Die, Android (on Ubuntu) -- This will be placed into your generic aliases collection
# Put to ~/.bash_aliases, and remember to source it in ~/.bashrc
alias 'dand=sudo killall -KILL qemu-system-i386'
# EDRA as an add-on, also into your ~/.bash_aliases
alias edra='vim ~/.bash_aliases; ba && hash -r'
# And ba - yet again it goes into ~/.bash_aliases
alias ba='. ~/bash_aliases; echo Realiased!'