Skip to content

Instantly share code, notes, and snippets.

View EddyBorja's full-sized avatar
😎

Eddy Borja EddyBorja

😎
View GitHub Profile
# ~/bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
source ~/.git-prompt.sh
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
@EddyBorja
EddyBorja / vimium
Created September 1, 2021 16:19
vimium custom css
div > .vimiumHintMarker {
padding: 3px 3px;
background-color: #FFe108;
border: 0;
border-radius: 0px;
box-shadow: 2px 2px 0 0 #00003030;
background-image: none;
}
div > .vimiumHintMarker span {
@EddyBorja
EddyBorja / .tmux.conf
Created August 31, 2021 21:05
Tmux config
#set-option -g allow-rename off
#HJKL Arrow key movement between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
#fast reload
@EddyBorja
EddyBorja / dockerlab.sh
Last active August 1, 2019 05:18
Script for Docker lab
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "Error: You need to run this script as root, bro"
exit 1
fi
apt-get remove docker docker-engine docker.io containerd runc -y
apt-get update -y
apt-get upgrade -y
@EddyBorja
EddyBorja / init.vim
Last active August 31, 2021 20:19
Neovim init
"\Before using, install vim-plug, This is an example of how to install for Neovim:
"curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
"you must also have fuzzy finder and silversearcher installed on the system to
"use <C-p> and <A-p> search commands.
"All plugins will be installed to ~/.local/share/nvim/plugged
call plug#begin('~/.local/share/nvim/plugged')
Plug 'chriskempson/base16-vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
@EddyBorja
EddyBorja / average_rating.sql
Created September 2, 2017 23:54
Example query for sorting an SQL table by average rating
SELECT id,
((positive + 1.9208) /
(positive + negative) - 1.96 *
SQRT((positive * negative) / (positive + negative) + 0.9604) /
(positive + negative)) /
(1 + 3.8416 /
(positive + negative)) AS ci_lower_bound
FROM some_table
WHERE positive + negative > 0
ORDER BY ci_lower_bound DESC;
@EddyBorja
EddyBorja / postgres_timestamp_functions.sql
Last active August 8, 2020 15:00
Convenience methods for some commonly used timestamps in analytics or reporting.
CREATE OR REPLACE FUNCTION day_begin(dt timestamp with time zone DEFAULT CURRENT_TIMESTAMP)
RETURNS timestamp with time zone AS $$
BEGIN
RETURN date_trunc('day', dt);
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION day_end(dt timestamp with time zone DEFAULT CURRENT_TIMESTAMP)
RETURNS timestamp with time zone AS $$
BEGIN
@EddyBorja
EddyBorja / javascript.snippets
Created February 17, 2016 19:36
React Class snippets with Meteor support
snippet reactClass "React Class Template"
import React from 'react';
export default class $1 extends React.Component {
render(){
return (
<div>
</div>
@EddyBorja
EddyBorja / .bash_profile
Last active September 9, 2017 14:54
Eddy Borja's basic bash profile
#Do not use this profile without copying .git-prompt.sh to the local machine first
source ~/.git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=1
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
export PS1="\[\033[0;33m\]\u:\[\033[1;33m\]\W\$(__git_ps1)\[\033[0;33m\]\$ \[\033[0m\]"
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
alias ls='ls -Gh'
@EddyBorja
EddyBorja / .vimrc
Last active March 12, 2017 16:12
Eddy Borja's vimrc file
" Before using, install Vundle with git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim"
" After cloning Vundle, run :PluginInstall command in vim "
" You may need to install the Menlo Powerline font for your terminal app to display correct characters for vim-powerline"
set nocompatible " be iMproved, required
filetype off " required
" Always show line numbers"
set number
" Line Color "