Skip to content

Instantly share code, notes, and snippets.

View miguelcostero's full-sized avatar
💻

Miguel Costero miguelcostero

💻
View GitHub Profile
@miguelcostero
miguelcostero / .bash_profile
Created June 25, 2017 01:48
custom bash prompt for linux rastafari
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\[\e[1;32m\][\u\[\e[1;33m\]@\[\e[1;31m\]\h]\[\e[1;33m\]: \[\e[1;37m\]\w\[\e[1;33m\] \$(parse_git_branch)\n\[\e[1;33m\]-> \[\e[0m\]"
@miguelcostero
miguelcostero / countries.json
Created July 17, 2017 15:04 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@miguelcostero
miguelcostero / Vagrantfile
Last active October 22, 2017 23:15
Ubuntu 16.04 LTS server, Apache 2 PHP 7 MySQL 5.6
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
@script = <<SCRIPT
# Script Configuration
WEBSITENAME="WEBSITE_NAME_HERE"
MYSQL_PASSWORD="MYSQL_ROOT_USER_PASSWORD"
@miguelcostero
miguelcostero / gist:a9dc85b9d03f05d1fd1f6126792947bb
Created November 14, 2017 10:56 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@miguelcostero
miguelcostero / .tmux.conf
Created June 3, 2018 23:59
tmux configuration | by: @tquizzle
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# split panes using | and -
bind | split-window -h
@miguelcostero
miguelcostero / app.module.ts
Created August 17, 2018 02:40 — forked from pniel-cohen/app.module.ts
Dynamically set page title based on active route in Angular 4
import ...
@NgModule({
...
providers: [ TitleService ],
})
export class AppModule {
constructor(titleService: TitleService) {
titleService.init();
}
@miguelcostero
miguelcostero / remount.sh
Created September 24, 2018 03:48 — forked from ertseyhan/remount.sh
Temporarily increase size of tmp folder on Arch linux
#!/bin/bash
sudo mount -o remount,size=10G,noatime /tmp
echo "Done. Please use 'df -h' to make sure folder size is increased."
@miguelcostero
miguelcostero / .eslintignore
Created October 12, 2018 21:29 — forked from remy/.eslintignore
My Next.js eslint config + `npm install --save-dev eslint eslint-config-airbnb eslint-plugin-react`
.next
out
@miguelcostero
miguelcostero / lock.sh
Created October 20, 2018 01:39
i3lock screen lock
#!/bin/bash
scrot /tmp/screen.png
xwobf -s 11 /tmp/screen.png
i3lock -i /tmp/screen.png
rm /tmp/screen.png