Skip to content

Instantly share code, notes, and snippets.

View ricgu8086's full-sized avatar

Ricardo Guerrero Gómez-Olmedo ricgu8086

View GitHub Profile
@cburgdorf
cburgdorf / xor_keras.py
Last active November 18, 2020 11:23
Comparing XOR between tensorflow and keras
import numpy as np
from keras.models import Sequential
from keras.layers.core import Activation, Dense
training_data = np.array([[0,0],[0,1],[1,0],[1,1]], "float32")
target_data = np.array([[0],[1],[1],[0]], "float32")
model = Sequential()
model.add(Dense(32, input_dim=2, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
@geohot
geohot / ransac_polyfit.py
Last active July 31, 2023 06:39
RANSAC polyfit. Fit polynomials with RANSAC in Python
def ransac_polyfit(x, y, order=3, n=20, k=100, t=0.1, d=100, f=0.8):
# Thanks https://en.wikipedia.org/wiki/Random_sample_consensus
# n – minimum number of data points required to fit the model
# k – maximum number of iterations allowed in the algorithm
# t – threshold value to determine when a data point fits a model
# d – number of close data points required to assert that a model fits well to data
# f – fraction of close data points required
besterr = np.inf
@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@mjdietzx
mjdietzx / waya-dl-setup.sh
Last active March 13, 2024 15:08
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream