Skip to content

Instantly share code, notes, and snippets.

View garbray's full-sized avatar

Bryan Garzón Bahamón garbray

View GitHub Profile
@garbray
garbray / .zshrc
Created July 14, 2020 13:57
git aliases
# git alias
alias gp="git pull"
alias gps="git push"
alias gpd="git pull develop"
alias gck="git checkout"
alias gr="git rebase"
alias grm="git rebase master"
alias gd="git diff"
alias gc="git commit"
alias gli="git log --oneline"
@garbray
garbray / .skhdrc
Last active June 27, 2020 17:13
Config yabairc
# open a new item2 process
# cmd - return : /Applications/iTerm.app/Contents/MacOS/iTerm2
# close all the iterm process
# cmd + shift - t : killall iTerm
# focus window
cmd + shift - h : yabai -m window --focus west
cmd + shift - j : yabai -m window --focus south
cmd + shift - k : yabai -m window --focus north
@garbray
garbray / .tmux.conf
Last active June 27, 2020 03:58
tmux base config
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
@garbray
garbray / machine.js
Last active June 13, 2020 21:34
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@garbray
garbray / clean_code.md
Created April 29, 2020 15:36 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var styleEl = document.getElementById('css-layout-hack');
if (styleEl) {
styleEl.remove();
return;
}
styleEl = document.createElement('style');
styleEl.id = 'css-layout-hack';
$(function () {
$.ajax({
method: "POST",
url: "http://nativo.herokuapp.com/api/sessions/login?HTTP_API_KEY=51a40exp274U7c2d58",
data: { "email": "[email protected]", "password": "demo1234"},
headers: {
'Content-Type': 'application/json',
'API_KEY': '51a40exp274U7c2d58'
}
}).done(function( msg ) {
jQuery(document).ready(function($){
//check if background-images have been loaded and show list items
$('.projects-container li').bgLoaded({
afterLoaded : function(){
showCaption($('.projects-container li').eq(0));
}
});
//open project
$('.projects-container li').on('click', function(){
{
order_id: orderNumber,
order: {
shipments_attributes: {
0: {
selected_shipping_rate_id: shipmentRateId,
id: shipmentId
}
}
}
{
line_id: lineId,
prop: {
receiving_user_id: userId,
recipient: recipient
}
}