Skip to content

Instantly share code, notes, and snippets.

View thefonso's full-sized avatar

thefonso thefonso

View GitHub Profile
@thefonso
thefonso / bash_profile
Last active June 15, 2018 10:14 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
alias mysql=/Applications/MAMP/Library/bin/mysql
@thefonso
thefonso / array_reverse.rb
Created September 4, 2017 06:43 — forked from abitdodgy/array_reverse.rb
Array Algorithms
#
# 2 - REVERSAL
#
# The quickest way to reverse an array is to swap elements at either end, and repeat
# while moving up from the left and down from the right.
#
# [ a b c d e f ]
# [ f a ] - Step 1 we switched A[0] with A[-1]
# [ e b ] - Step 2 we switched A[1] with A[-2]
# [ d c ] - Step 3 we switched A[2] with A[-3]
@thefonso
thefonso / gist:a119fe64c5d5f4ee986d44eb51cd39df
Created October 9, 2016 18:54 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@thefonso
thefonso / rbenv-howto.md
Created September 28, 2016 04:41 — forked from MicahElliott/rbenv-howto.md
Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

@thefonso
thefonso / seeyouspacecowboy.sh
Created September 3, 2016 00:14
A shell script to display SEE YOU SPACE COWBOY whenever you logout of your terminal!
#!/usr/bin/env bash
# SEE YOU SPACE COWBOY by DANIEL REHN (danielrehn.com)
# Displays a timeless message in your terminal with cosmic color effects
# Usage: add "sh ~/seeyouspacecowboy.sh; sleep 2" to .bash_logout (or similar) in your home directory
# (adjust the sleep variable to display the message for more seconds)
# Cosmic color sequence
@thefonso
thefonso / index.md
Last active August 29, 2015 14:17 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

Effectively Reviewing a Pull Request
====================================
How do they work?
-----------------
- code on a branch or fork
- open pull request
- have people review code
- potentially update the code
- merge pull request
@thefonso
thefonso / index.hbs
Last active August 29, 2015 14:10 — forked from bojicas/index.hbs
<section id="todoapp">
<header id="header">
<h1>todos</h1>
<input type="text" id="new-todo" placeholder="What needs to be done?" />
</header>
<section id="main">
<ul id="todo-list">
<li class="completed">
<input type="checkbox" class="toggle">
{{outlet}}
<footer id="info">
<p>Double-click to edit a todo</p>
</footer>