diskutil list # Find out your Raspberry Pi drive
diskutil unmountDisk /dev/disk2 # Unmount disk
sudo dd if=/dev/disk2 of=raspberry_pi_backup.img # Create backup image
gzip -c raspberry_pi_backup.img > raspberry_pi_backup.img.gz # Compress image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printControls(){ | |
var controls = $('<div></div>') | |
.attr('id', 'controls') | |
.append( | |
$('<button></button>').text( 'rodar uma geração' ).attr( 'id', 'ciclo' ) | |
) | |
.click( function(){ | |
cycle(); | |
}); | |
$( cfg.screen ).append(controls); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import graphlab | |
import numpy as np | |
from sklearn.cross_validation import train_test_split | |
def main(): | |
sales = graphlab.SFrame('kc_house_data.gl') | |
train_data_graphlab, test_data_graphlab = sales.random_split(0.8, seed=0) | |
input_graphlab = train_data_graphlab['sqft_living'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def merg(a, b): | |
# This method takes care of merging two lists while maintaining it sorted. | |
# Hence, it must only return the resulting merged list, not the indices i | |
# and j. | |
c = [None] * int(len(a) + len(b)) | |
i = 0 | |
j = 0 | |
k = 0 # This will take care of where we are placing the new elements | |
# i and j must be strictly less than the lengths, otherwise they'll overflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import simpletable | |
def main(): | |
data = '''basesystem-10.0-7.el7.centos.noarch | |
checksum_data = 0280ee16df09be0cebf62695706598caed8ff5cba47de1fed625068a90a9ef68 | |
checksum_type = sha256 | |
from_repo = anaconda | |
from_repo_revision = 1489513119 | |
from_repo_timestamp = 1489513374 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew install python3 | |
$ pip3 install virtualenv virtualenvwrapper | |
$ vim .bash_profile # or .zshrc | |
# Virtualenv variables | |
export WORKON_HOME=/Users/portela/.virtualenvs | |
export VIRTUALENVWRAPPER_PYTHON=$(which python3) | |
source /usr/local/bin/virtualenvwrapper.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
$VERBOSE = nil |