Skip to content

Instantly share code, notes, and snippets.

View nfabredev's full-sized avatar
💭
💻 🗺

nfabredev nfabredev

💭
💻 🗺
View GitHub Profile
|> Enum.map(&Atom.to_string/1)
# |> Enum.map(fn field -> Atom.to_string(field) end)
#|> Enum.map(&Atom.to_string(&1))
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nfabredev
nfabredev / .bashrc
Created March 18, 2019 06:51
New bashrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# nvm auto-switch
find-up () {
path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
@nfabredev
nfabredev / launch.json[NEW]
Created March 13, 2019 10:28
Launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "RSpec - active spec file only",
"type": "Ruby",
"request": "launch",
@nfabredev
nfabredev / launch.json
Created February 14, 2019 14:25 — forked from nicolasrouanne/VSCODE_LAUNCH.md
VS Code configuration for Ruby
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Local File",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/main.rb"
},
var docWidth = document.documentElement.offsetWidth;
[].forEach.call(
document.querySelectorAll('*'),
function(el) {
if (el.offsetWidth > docWidth) {
console.log(el);
}
}
);
@nfabredev
nfabredev / how to setup & use rvm
Last active April 18, 2018 15:40
how to setup & use rvm coming from rbenv
If you are coming from rbven do that first:
`brew remove rbenv`
`rm -rf ~/.rbenv`
Then install rvm:
`gpg --keyserver hkp://pgp.mit.edu--recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3`
`\curl -sSL https://get.rvm.io | bash -s stable --ruby`
Enable tab completion:
`nano .bashrc`
@nfabredev
nfabredev / .git-completion.bash
Created February 7, 2018 14:05
Git completions
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
@nfabredev
nfabredev / Git branch bash autocomplete *with aliases*
Created December 15, 2017 10:49 — forked from JuggoPop/Git branch bash autocomplete *with aliases*
Git branch bash autocomplete *with aliases* (add to .bash_profile)
# To Setup:
# 1) Save the .git-completion.bash file found here:
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect:
# Git branch bash completion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
# Add git completion to aliases
@nfabredev
nfabredev / postgres-cheatsheet.md
Created November 15, 2017 14:15 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)