Skip to content

Instantly share code, notes, and snippets.

View helderc's full-sized avatar

Helder Oliveira helderc

View GitHub Profile
@mkarpp
mkarpp / hyperopt.ipynb
Created November 22, 2019 09:22
hyperopt.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@webinista
webinista / pelicanconf.py
Last active April 10, 2023 23:07
A Pelican configuration for having a home page and blog index or landing page.
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# --------------------------------------
# Now compatible with Pelican 4.0.x!
# --------------------------------------
# Added by me
import time
@wassname
wassname / augumented_hdf5_matrix.py
Last active October 11, 2020 23:32
How to do data augmentation on a keras HDF5Matrix
"""Another way, note this one will load the whole array into memory ."""
from keras.preprocessing.image import ImageDataGenerator
import h5py
from keras.utils.io_utils import HDF5Matrix
seed=0
batch_size=32
# we create two instances with the same arguments
data_gen_args = dict(
rotation_range=90.,
@max-mapper
max-mapper / bibtex.png
Last active March 10, 2024 21:53
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@rtbs-dev
rtbs-dev / pmml_bayesnet.ipynb
Last active March 24, 2023 16:43
Bayesian Network Models in PyMC3 and NetworkX
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexlee-gk
alexlee-gk / configure_cuda_p70.md
Last active March 19, 2024 17:47
Use integrated graphics for display and NVIDIA GPU for CUDA on Ubuntu 14.04

This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)

A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly. In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers. This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa in the command-line.

@pratos
pratos / condaenv.txt
Created November 30, 2016 07:01
To package a conda environment (Requirement.txt and virtual environment)
# For Windows users# Note: <> denotes changes to be made
#Create a conda environment
conda create --name <environment-name> python=<version:2.7/3.5>
#To create a requirements.txt file:
conda list #Gives you list of packages used for the environment
conda list -e > requirements.txt #Save all the info about packages to your folder
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active April 25, 2024 17:23
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@etes
etes / pi_mount_usb.md
Last active March 14, 2024 17:31
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following

@jonlabelle
jonlabelle / vim_cheatsheet.md
Last active December 17, 2020 07:54
Vim Cheatsheet

Vim Cheatsheet

To open a file in Vim:

vim <filename>
Navigation
h move one character left
j move one row down