Skip to content

Instantly share code, notes, and snippets.

View fernandes's full-sized avatar
🤓
Programming

Celso Fernandes fernandes

🤓
Programming
View GitHub Profile
@fernandes
fernandes / di.sh
Last active June 24, 2019 19:16
Download all playlists from di.fm
#/bin/sh
# Adapted from http://mpd.wikia.com/wiki/Hack:di.fm-playlists
URL="http://listen.di.fm/public3"
token=$1; dir=$2
if [ "$dir" == "" -o "$token" == "" ]; then
echo "Usage: $0 TOKEN PATH_TO_SAVE"
@fernandes
fernandes / check_ssl_use.sh
Created April 9, 2014 14:24
Check processes that are using OpenSSL - useful to check what need to be restarted http://heartbleed.com/
#!/bin/bash
while read pid; do
ls -l /proc/${pid}/exe|awk -F" " '{print $11}'
done < <(lsof|egrep libssl|awk -F" " '{print $2'})|sort -d|uniq
@fernandes
fernandes / tmux_cheatsheet.txt
Last active August 29, 2015 14:02
my tmux cheatsheet
# Cheat Sheet
## TMUX
starts new session tmux new -s <name>
attach deatached session tmux (a)ttach -t <name>
list sessions tmux ls
### Windows
new window ^a c
list windows ^a w
@fernandes
fernandes / vim_cheatsheet.txt
Created June 30, 2014 13:45
my vim cheatsheet.txt
## Vim
### Basic
enable line numbers :set number | :set nu
disable line numbers :set nonumber | :set nonu | :set nu!
enable relative numbers :set relativenumber
convert entire word to uppercace <leader>u
convert entire word to lowercase <leader>l
convert first char of word to uppercase <leader>U
convert first char of word to lowercase <leader>L
@fernandes
fernandes / cobra.md
Last active June 19, 2020 16:22
COBRA - Component-Based Rails Applications

Component-Based Rails Applications (#cobra)

What is it?

Cobra is a way to organize your rails application, imagine it like a new way for packaging your rails apps

These are my annotations based on work of @shageman and @benjaminleesmith from Pivotal

Baby steps

@fernandes
fernandes / keybase.md
Created December 17, 2014 01:20
Keybase.io Gist Proof

Keybase proof

I hereby claim:

  • I am fernandes on github.
  • I am celsovjf (https://keybase.io/celsovjf) on keybase.
  • I have a public key whose fingerprint is 9D00 08CD 3979 93B2 42CD E0F8 40DF 674A CECC B224

To claim this, I am signing this object:

@fernandes
fernandes / gist:43346ae8706e94d09fea
Last active August 29, 2015 14:19
Rails Guides ActiveRecord Examples
# If for any reason you need to reproduce the Rails Guides ActiveRecord examples
# this gist will make your life easier
#############################
### Has Many / Belongs To ###
#############################
# be rails g model Order order_date:datetime customer:references
class Order < ActiveRecord::Base
belongs_to :customer
@fernandes
fernandes / nokogiri.sh
Last active August 29, 2015 14:23
Compile nokogiri with native libs
# Operating System: OSX 10.10.3
# Boxen + Brew
brew install libxml2 libxslt
gem install nokogiri -- \
--use-system-libraries \
--with-xml2-lib=/opt/boxen/homebrew/opt/libxml2/lib \
--with-xml2-include=/opt/boxen/homebrew/opt/libxml2/include/libxml2 \
--with-xslt-lib=/opt/boxen/homebrew/opt/libxslt/lib \
@fernandes
fernandes / active_record.rb
Last active August 29, 2015 14:26
YARDoc CheatSheet
# This class is an org
class Organization < ActiveRecord::Base
# @!attribute name
# @return [String] The name of the task.
# @!attribute description
# @return [String] The description of the task.
# @!attribute active
# @return [Boolean] Marks whether the task is active or not.
@fernandes
fernandes / memes.txt
Last active February 20, 2017 22:58
memes
(╯°□°)╯︵ ┻━┻
¯\_(ツ)_/¯
oslǝɔ
oslǝƆ
osןǝɔ