Skip to content

Instantly share code, notes, and snippets.

View wachpwnski's full-sized avatar

John Wachowski wachpwnski

View GitHub Profile
@fabiobiondi
fabiobiondi / App.js
Last active April 14, 2019 17:21
EaselJS and HTML5 Canvas - ES6 Custom Display Objects (based on ES5 version: http://www.createjs.com/tutorials/Inheritance/)
import CircleButton from './CircleButton';
// Init stage
const stage = new createjs.Stage("demo");
// Button black
const btn = new CircleButton('Hi');
btn.x = 50; btn.y = 50;
stage.addChild(btn);
@Howon
Howon / ImagePhash.scala
Created August 21, 2015 08:33
PHash implementation written in scala
import java.awt.Graphics2D
import java.awt.image.BufferedImage
import java.io.InputStream
import javax.imageio.ImageIO
import java.io._
class ImagePHashScala(size: Int = 32, smallerSize: Int= 8){
val c : Array[Double] = {
val temp = Array.ofDim[Double](size)
for (i <- 1 to size - 1) {
@Fishrock123
Fishrock123 / gulp.js
Last active August 1, 2021 11:19
gulp & browserify (+watchify +babelify)
var gulp = require('gulp')
var browserify = require('browserify')
var watchify = require('watchify')
var babelify = require('babelify')
var source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer')
var merge = require('utils-merge')
@TheDistantSea
TheDistantSea / version_compare.js
Created December 18, 2013 12:19
Function to compare two version strings (e.g. "1.6.1" is smaller than "1.7"). Developed in order to answer http://stackoverflow.com/a/6832721/50079.
/**
* Compares two software version numbers (e.g. "1.7.1" or "1.2b").
*
* This function was born in http://stackoverflow.com/a/6832721.
*
* @param {string} v1 The first version to be compared.
* @param {string} v2 The second version to be compared.
* @param {object} [options] Optional flags that affect comparison behavior:
* <ul>
* <li>
@thearn
thearn / opencv-python-ipcam.py
Last active January 12, 2023 17:01
python-opencv ip camera example
import base64
import time
import urllib2
import cv2
import numpy as np
"""
Examples of objects for image frame aquisition from both IP and
@pcolazurdo
pcolazurdo / InstallGraphite
Last active December 11, 2015 10:48
Installing & Configuring Distributed LogStash + Kibana + Redis + Graphite + Statsd on a RedHat Fedora 18
### Based on: https://gist.github.com/1191574
### Based on: http://graphite.wikidot.com/installation
### for Django 1.4 review: https://bugs.launchpad.net/graphite/+bug/963684
### Statsd: http://geek.michaelgrace.org/2011/09/installing-statsd-on-ubuntu-server-10-04/
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
@wickman
wickman / README.md
Created April 12, 2012 22:55
Python development in Pants (tutorial)

Python development using Pants

brian wickman - @wickman

[TOC]

Why use Pants for Python development?

Pants makes the manipulation and distribution of hermetically sealed Python environments

@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(