Skip to content

Instantly share code, notes, and snippets.

View shikaan's full-sized avatar
🐽

Manuel Spagnolo shikaan

🐽
View GitHub Profile
@shikaan
shikaan / Microsoft.PowerShell_profile.ps1
Created May 19, 2018 14:21
Powershell script to make the prompt look like git-bash
function Write-BranchName () {
try {
$branch = git rev-parse --abbrev-ref HEAD
if ($branch -eq "HEAD") {
# we're probably in detached HEAD state, so print the SHA
$branch = git rev-parse --short HEAD
Write-Host " ($branch)" -ForegroundColor "red"
}
else {
@shikaan
shikaan / app.js
Last active November 11, 2018 08:14
Command Pattern in Frontend JavaScript
// Concrete Command
class OpenAlertCommand {
constructor(receiver) {
this.receiver = receiver
}
execute() {
this.receiver.alert('Gotcha!')
}
}
@shikaan
shikaan / jetbrains-phpstorm.desktop
Created March 12, 2019 12:24
JetBrains shortcuts for local environment
[Desktop Entry]
Version=1.0
Type=Application
Name=PhpStorm
Icon=/home/manuel/.local/opt/Webstorm/bin/phpstorm.svg
Exec="/home/manuel/.local/opt/Webstorm/bin/phpstorm.sh" %f
Comment=The Lightning-Smart PHP IDE
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-phpstorm
@shikaan
shikaan / .bashrc
Created May 6, 2019 13:44
Add git branch info to your bash
# Show git branch name
force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\] $(parse_git_branch)\[\033[00m\]\n\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\n\$ '
@shikaan
shikaan / settings.json
Created July 1, 2019 15:02
Python Color for Peacock
{
"workbench.colorCustomizations": {
"activityBar.background": "#306998",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#ffd43b",
"activityBarBadge.foreground": "#646464",
"titleBar.activeBackground": "#306998",
"titleBar.inactiveBackground": "#4b8bbe",
"titleBar.activeForeground": "#e7e7e7",
@shikaan
shikaan / changelog.sh
Last active October 14, 2019 14:31
Generate Changelogs with Conventional Commits
#!/usr/bin/env bash
tag=
branch=
tag_value=
branch_value=
has_options=
print_usage() {
name="$(basename $0)"
@shikaan
shikaan / .tmux.conf
Last active March 19, 2023 21:23
tmux + Vim Configuration
set -g mouse on
set -g status-style "bg=default"
set -g window-status-current-style "bg=default,reverse"
set -g window-status-separator '|'
set -g window-status-format " #W#{?window_flags,#F, } (M-#I) "
set -g window-status-current-format " #W#{?window_flags,#F, } (M-#I) "
set -g base-index 1
set-window-option -g pane-base-index 1
@shikaan
shikaan / random-mute-mac.sh
Last active October 8, 2020 19:27
Randomly remove volume to practice timing
#! /usr/bin/env bash
SLEEP="$1"
while [[ 1 -eq 1 ]]; do
if [[ $(($RANDOM % 2)) -eq 0 ]]; then
echo "Mute"
sudo osascript -e "set volume output muted true"
else
echo "Unmute"
@shikaan
shikaan / loopback-record.sh
Created May 8, 2020 23:30
Use ALSA to perform loopback record
#!/usr/bin/env bash
DATE_HASH=$(date '+%Y%m%d%H%M%S')
DEFAULT_LOCATION="$HOME/recording-$DATE_HASH.wav"
printf "\e[1mCreating loopback devices...\e[0m\n\n"
sudo modprobe snd-aloop
RAW_LOOPBACK_DEVICES=$(aplay -l | grep Loopback | sed -E "s/card\s([0-9]+).*device\s([0-9]*).*/hw:\1,\2/g" -)
@shikaan
shikaan / bootstraper.sh
Created May 31, 2020 19:25
Bootstrap a simple and opinionated frontend application
#!/bin/bash
# CONFIGURATION
readonly SCRIPT="$(basename $0)"
readonly APP_NAME=$1
readonly TIMEOUT=.5
# FILES
readonly GITIGNORE="""
node_modules