Skip to content

Instantly share code, notes, and snippets.

Always wondering.

Charles De Barros charlesdebarros

Always wondering.
View GitHub Profile
bradtraversy /
Last active Dec 3, 2020
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

LeCoupa / redis_cheatsheet.bash
Last active Dec 3, 2020
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION -->
View redis_cheatsheet.bash
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
View books.csv
Title Author Genre Height Publisher
Fundamentals of Wavelets Goswami, Jaideva signal_processing 228 Wiley
Data Smart Foreman, John data_science 235 Wiley
God Created the Integers Hawking, Stephen mathematics 197 Penguin
Superfreakonomics Dubner, Stephen economics 179 HarperCollins
Orientalism Said, Edward history 197 Penguin
Nature of Statistical Learning Theory, The Vapnik, Vladimir data_science 230 Springer
Integration of the Indian States Menon, V P history 217 Orient Blackswan
Drunkard's Walk, The Mlodinow, Leonard science 197 Penguin
Image Processing & Mathematical Morphology Shih, Frank signal_processing 241 CRC
#!/usr/bin/env bash
# Originally from
# authors: Ian Vaughan
# Jacob Zimmerman
# usage: uninstall_gems [<version> ...]
# examples:
# Sublime Text 3 Install (last update: Monday 13 March 2017)
# No need to download this script, just run it on your terminal:
# curl -L | sh
# Detect the architecture
rosswd /
Last active Nov 9, 2020
Setting up a Github and Bitbucket account on the same computer on Mac OS. Now with a guide for Windows 10.

Setting up github and bitbucket on the same computer (Windows)

Guide for Windows

mix3d asked for some help using this guide with windows so here we go. This was tested with Windows 10. Run all commands in Git Bash once it's installed.

Github will be the main account and bitbucket the secondary.

Git for Windows

  • Download and install Git for Windows
    • In the installer, select everything but decide if you want a desktop icon (2nd step)
tlowrimore / union_scope.rb
Last active Feb 19, 2019
Unions multiple scopes on a model, and returns an instance of ActiveRecord::Relation.
View union_scope.rb
module ActiveRecord::UnionScope
def self.included(base)
base.send :extend, ClassMethods
module ClassMethods
def union_scope(*scopes)
id_column = "#{table_name}.#{primary_key}"
sub_query = { |s| }.join(" UNION ")
where "#{id_column} IN (#{sub_query})"
thebinarypenguin / spreadsheet-examples.rb
Created Nov 9, 2012
Read and write spreadsheets with ruby using the spreadsheet gem
View spreadsheet-examples.rb
# Read and write spreadsheets with ruby using the spreadsheet gem
# Full Docs:
require 'spreadsheet'
# Open source spreadsheet
workbook = 'source.xls'
IanVaughan /
Created Jun 9, 2012
Uninstall all rbenv gems
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
gem list
gem install bundler
You can’t perform that action at this time.