Skip to content

Instantly share code, notes, and snippets.

Avatar

Junio Vitorino juniovitorino

View GitHub Profile
@juniovitorino
juniovitorino / tmux.md
Created Jan 9, 2021 — forked from andreyvit/tmux.md
tmux cheatsheet
View tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
@juniovitorino
juniovitorino / init.vim
Last active Jan 8, 2021
Custom init.vim config file
View init.vim
" NeoVim CONFIG
" Plugin Section
call plug#begin("~/.vim/plugged")
Plug 'terryma/vim-multiple-cursors'
Plug 'scrooloose/nerdtree'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim' " brew install the_silver_searcher ripgrep
Plug 'ryanoasis/vim-devicons'
Plug 'jiangmiao/auto-pairs'
View init.vim
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
View index.html
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>JS Module in Browser</title>
<script type="module" src="./js/main.js"></script>
</head>
<body></body>
</html>
@juniovitorino
juniovitorino / init.sh
Created Jun 29, 2016 — forked from tmiller/init.sh
DigitalOcean ubuntu 14.04 server configuration script.
View init.sh
#!/bin/bash
username="ubuntu"
ssh_pub_key=""
# Setup user
adduser $username
usermod -a -G sudo $username
sudo mkdir -p "/home/${username}/.ssh"
sudo echo "${ssh_pub_key}" > "/home/${username}/.ssh/authorized_keys"
View excerpt-character-counter.php
function excerpt_count_js(){
if ('page' != get_post_type()) {
echo '<script>jQuery(document).ready(function(){
jQuery("#postexcerpt .handlediv").after("<div style=\"position:absolute;top:12px;right:34px;color:#666;\"><small>Excerpt length: </small><span id=\"excerpt_counter\"></span><span style=\"font-weight:bold; padding-left:7px;\">/ 500</span><small><span style=\"font-weight:bold; padding-left:7px;\">character(s).</span></small></div>");
jQuery("span#excerpt_counter").text(jQuery("#excerpt").val().length);
jQuery("#excerpt").keyup( function() {
if(jQuery(this).val().length > 500){
jQuery(this).val(jQuery(this).val().substr(0, 500));
View gist:75d45df5f0ae54d2e7b1
<?php
// DATABASE
define('DB_NAME', getenv('DB_NAME'));
define('DB_USER', getenv('DB_USER'));
define('DB_PASSWORD', getenv('DB_PASS'));
define('DB_HOST', getenv('DB_HOST'));
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', 'utf8_general_ci');
View gist:c25c2cc15db4feb220db
<?php
// DATABASE
define('DB_NAME', getenv('DB_NAME'));
define('DB_USER', getenv('DB_USER'));
define('DB_PASSWORD', getenv('DB_PASS'));
define('DB_HOST', getenv('DB_HOST'));
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', 'utf8_general_ci');
@juniovitorino
juniovitorino / backup.sh
Created Nov 20, 2014
CLONE CLIENTES PARTITION AND SAVE COMPRESSED IMAGE IN AN EXTERNAL HARD DISK (USB)
View backup.sh
#!/bin/bash
# AUTHOR: JUNIO VITORINO | jgvitorino@gmail.com
# DESCRIPTION: DAILY CLONE CLIENTES PARTITION AND SAVE COMPRESSED IMAGE IN AN EXTERNAL HARD DISK (USB)
# DATE: NOVEMBER 20, 2014
rm -rf /backup/*.gz
now=$(date +"%m_%d_%Y")
dd if=/dev/sda5 conv=sync,noerror bs=1K | gzip -c > "/backup/dd_image_clientes_$now.gz"
@juniovitorino
juniovitorino / ncenter
Created Nov 12, 2013
Load/Unload OS X Notification Center
View ncenter
# Notification Center
alias ncstop="launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist"
alias ncstart="launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist"