Skip to content

Instantly share code, notes, and snippets.

View bygreencn's full-sized avatar
💭
I may be slow to respond.

bygreencn bygreencn

💭
I may be slow to respond.
View GitHub Profile
@bygreencn
bygreencn / workflows-in-django.md
Created October 26, 2018 03:33 — forked from Nagyman/workflows-in-django.md
Workflows in Django

Workflows (States) in Django

I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.

Common Software Uses

  • Publishing (Draft->Approved->Published->Expired->Deleted)
@bygreencn
bygreencn / README.md
Created September 19, 2018 13:33 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@bygreencn
bygreencn / ManualHough.py
Created July 12, 2018 03:04 — forked from ri-sh/ManualHough.py
Hough Lines from scratch using opencv and numpy
# imports
import numpy as np
import cv2
import matplotlib.pyplot as plt
# The Hough Transform is a popular algorithm for detecting any shape that can
# be represented in a parametric mathmatical form in binary images. This
# usually means that images need to be thresholded or filtered prior to running
@bygreencn
bygreencn / imgcmp.py
Created April 28, 2018 14:19 — forked from attilaolah/imgcmp.py
Fast image comparison with Python
import math
import Image
import Levenshtein
class BWImageCompare(object):
"""Compares two images (b/w)."""
_pixel = 255
@bygreencn
bygreencn / ThresholdingAlgo.py
Created March 13, 2018 09:15 — forked from ximeg/ ThresholdingAlgo.py
Python implementation of smoothed z-score algorithm from http://stackoverflow.com/a/22640362/6029703
#!/usr/bin/env python
# Implementation of algorithm from http://stackoverflow.com/a/22640362/6029703
import numpy as np
import pylab
def thresholding_algo(y, lag, threshold, influence):
signals = np.zeros(len(y))
filteredY = np.array(y)
avgFilter = [0]*len(y)
stdFilter = [0]*len(y)
@bygreencn
bygreencn / Xenomai Linux RPI 3.txt
Created February 20, 2018 06:34
Croscompillation of RT linux with xenomai for RPI3
XenomaiVersion=3.0.5
KernelVersion=4.9.y
PLATFORM=arm
git clone https://github.com/raspberrypi/linux.git -b rpi-${KernelVersion} --depth 1
wget http://xenomai.org/downloads/xenomai/stable/xenomai-${XenomaiVersion}.tar.bz2
wget http://xenomai.org/downloads/ipipe/v4.x/arm/ipipe-core-4.4.43-arm-8.patch
wget http://busybox.net/downloads/busybox-1.26.2.tar.bz2
@bygreencn
bygreencn / opencv249.props
Created July 28, 2017 04:11 — forked from atinfinity/opencv249.props
OpenCV2.4.9用プロパティシート(VS2010/VS2012/VS2013/VS2015共通)
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<OPENCV_INSTALL_DIR>C:\dev\opencv-2.4.9\build\install</OPENCV_INSTALL_DIR>
</PropertyGroup>
<!-- Debug|Win32 -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@bygreencn
bygreencn / PCL.md
Created July 26, 2017 09:33 — forked from UnaNancyOwen/PCL1.10.0.md
Building PCL with Visual Studio
@bygreencn
bygreencn / VTK5.md
Created July 26, 2017 09:31 — forked from UnaNancyOwen/VTK5.md
Building VTK with Visual Studio
@bygreencn
bygreencn / Install NVIDIA Driver and CUDA.md
Created July 17, 2017 06:09 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora