Skip to content

Instantly share code, notes, and snippets.

View aalvarado's full-sized avatar
😎

Adan Alvarado aalvarado

😎
View GitHub Profile
@aalvarado
aalvarado / tmux.conf
Last active June 5, 2023 22:26
tmux.conf
set -g update-environment -r
# set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.tmux/plugins/'
set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
#set -g default-terminal "tmux-256color"
# set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
set -g prefix M-p
# split panes using | and -
bind | split-window -h -c "#{pane_current_path}"
@aalvarado
aalvarado / aliases.sh
Last active June 5, 2023 23:49
aliases
alias ack='rg --color always --no-block-buffered -n -i'
alias acs='apt-cache search'
alias bd='. bd -s'
alias gb='git branch'
alias gca='git add . && git commit --amend -C HEAD && git push -f'
alias gd='git diff'
alias gdc='git diff --cached'
alias gl=" git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gp='git push -u'
alias gpu='git push -u'
@aalvarado
aalvarado / keybase.md
Created November 30, 2021 20:59
keybase.md

Keybase proof

I hereby claim:

  • I am aalvarado on github.
  • I am adantj (https://keybase.io/adantj) on keybase.
  • I have a public key ASDVzoFdsJZ2XrWVJCP6piQo_J9C7xCAufnOoltiXhkpawo

To claim this, I am signing this object:

@aalvarado
aalvarado / main.rs
Created February 23, 2019 19:17
Naive circular queue in Rust
use std::fmt;
#[derive(Debug)]
struct CircularQueue<T> {
max: usize,
list: Vec<T>,
}
impl <T> CircularQueue<T> where T: std::string::ToString {
pub fn new(max: usize) -> CircularQueue<T> {
@aalvarado
aalvarado / .ctags
Created July 11, 2018 22:00
.ctags
--exclude=*.json
--exclude=*.lock
--exclude=*.yaml
--exclude=.bundle
--exclude=Gemfile
--exclude=Gemfile.lock
--exclude=*.git*
--exclude=*.pyc
{
"title": "Escape enhancements",
"rules": [
{
"description": "Escape toggles capslock if enabled",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
@aalvarado
aalvarado / _Algorithms_
Last active August 22, 2018 16:48
Algorithms
1
struct Person;
impl Person {
fn hello(&self) -> &'static str {
return "hello";
}
}
fn main() {
println!("Hello, world!");
let p = Person;
@aalvarado
aalvarado / pg_change_db_owner.sh
Created September 29, 2015 18:03 — forked from jirutka/pg_change_db_owner.sh
Some convenient scripts to manage ownerships and privileges in PostgreSQL.
#!/bin/bash
#
# The MIT License
#
# Copyright 2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@aalvarado
aalvarado / fizzbuzz.rb
Created June 1, 2015 14:42
FizzBuzz Ruby without any integer modulus or division
limit = 100
fizz = ['']*2 << 'fizz'
buzz = ['']*4 << 'buzz'
(1..limit).to_a.zip(fizz.cycle(limit).to_a.zip(buzz.cycle(limit).to_a)).each{ |n| puts n.join(' ') }