Skip to content

Instantly share code, notes, and snippets.

View sordonia120446's full-sized avatar

Samuel Ordonia sordonia120446

View GitHub Profile
@sordonia120446
sordonia120446 / open_cv.py
Created October 17, 2018 01:55
Open CV Image Manipulation
"""
Docs: https://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html
"""
import cv2
import numpy as np
def affine_transform(img):
rows, cols, ch = img.shape
pts1 = np.float32([[50, 50], [200, 50], [50, 200]])
@sordonia120446
sordonia120446 / mnist_binary_classifier.py
Last active October 16, 2020 06:42
MNIST Binary Classifier
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
class SamNet(nn.Module):
@sordonia120446
sordonia120446 / fix-homebrew-npm.md
Created November 10, 2016 07:21 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.