Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Zanco dangpzanco

  • Florianópolis, Brasil
View GitHub Profile
View image_frying.py
import pathlib
import tqdm
import imageio
# import PIL.Image
# PIL.Image.MAX_IMAGE_PIXELS = 933120000
# input_path = pathlib.Path('Starry Night.jpg')
input_path = pathlib.Path('Starry Night (small).jpg')
im = imageio.imread(input_path)
View run_with_save.py
import pathlib # Handle paths (https://pbpython.com/pathlib-intro.html)
import numpy as np
def run_simulation(n=1000):
x = np.random.randn(n)
y = np.random.randn(n,n) @ x
simulation_results = dict(x=x, y=y)
return simulation_results
@dangpzanco
dangpzanco / setup_conda.sh
Last active Oct 11, 2019
Setup Miniconda on a fresh linux installation.
View setup_conda.sh
#!/bin/bash
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
mkdir ~/.conda # https://github.com/ContinuumIO/anaconda-issues/issues/11148
sh Miniconda3-latest-Linux-x86_64.sh
conda update --all -y
conda install -y tensorflow git
git clone https://github.com/tensorflow/benchmarks
@dangpzanco
dangpzanco / climate_change_ai.md
Last active Jun 13, 2020
"Climate Change: How Can AI Help?" ICML2019 Workshop Highlights
View climate_change_ai.md
@dangpzanco
dangpzanco / readme.md
Created May 24, 2019
Gist Markdown Cheatsheet
View readme.md

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Paragraph

View generate_noise_dataset.py
import numpy as np
import librosa
import pandas as pd
import numpy.random as rnd
import pathlib
import tqdm
dataset_folder = pathlib.Path('noise_data')
dataset_folder.mkdir(parents=True, exist_ok=True)
View termux-ubuntu.sh
#!/data/data/com.termux/files/usr/bin/bash
folder=ubuntu-fs
if [ -d "$folder" ]; then
first=1
echo "skipping downloading"
fi
tarball="ubuntu.tar.gz"
if [ "$first" != 1 ];then
if [ ! -f $tarball ]; then
View log_cc1350.py
import serial
import sys
import argparse
import csv
import pathlib
from datetime import datetime
def list_serial_ports():
""" Lists serial port names
@dangpzanco
dangpzanco / gnuradio_dead_branch
Created Aug 21, 2018
Attention! You're using a dead branch.
View gnuradio_dead_branch
___________________________________________________________________
/ _ _ _ _ _ _ \
| /_\ | |_ | |_ ___ _ _ | |_ (_) ___ _ _ | | |
| / _ \| _|| _|/ -_)| ' \| _|| |/ _ \| ' \ |_| |
| /_/ \_\\__| \__|\___||_||_|\__||_|\___/|_||_|(_) |
| |
| __ __ _ _ |
| \ \ / /___ _ _ ( )_ _ ___ _ _ ___(_) _ _ __ _ __ _ |
| \ V // _ \| || ||/| '_|/ -_) | || |(_-<| || ' \ / _` | / _` | |
| |_| \___/ \_,_| |_| \___| \_,_|/__/|_||_||_|\__, | \__,_| |
@dangpzanco
dangpzanco / build-gnuradio.sh
Last active Oct 17, 2020
build-gnuradio script updated for Ubuntu 16.04
View build-gnuradio.sh
#!/bin/bash
#
# Build script for UHD+GnuRadio on Fedora and Ubuntu
#
#
#
# Updates: https://github.com/guruofquality/grextras/wiki
# Updates: https://github.com/balint256/gr-baz.git
#
#