Skip to content

Instantly share code, notes, and snippets.

/*
* Simple hash map using javascript objects and an ordered array.
* Repeated elements are not allowed.
*
* @param sort_method By default is ASC order, but you can specified whatever you want.
*
* The public methods are:
* -set
* -get
* -del

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

  1. General Background and Overview

Easy handle interface

Options

Info

@alixaxel
alixaxel / hacks.css
Created November 20, 2011 20:59 — forked from xeoncross/hacks.css
CSS hacks
/*
Comprehensive List of Browser-Specific CSS Hacks
http://paulirish.com/2009/browser-specific-css-hacks/
*/
/***** Selector Hacks ******/
/* IE6 and below */
* html #uno { color: red }
<?php
require('pathing.php');
$gmap = array(
array(6, 5, 6, 4, 6, 1, 2, 6, 9, 6, 6, 5, 6, 4, 6, 1, 2, 6, 9, 6),
array(8, 5, 3, 2, 9, 9, 3, 2, 4, 7, 8, 5, 3, 2, 9, 9, 3, 2, 4, 7),
array(4, 8, 7, 7, 3, 5, 2, 8, 3, 5, 4, 8, 7, 7, 3, 5, 2, 8, 3, 5),
array(7, 5, 5, 8, 7, 7, 8, 4, 8, 5, 7, 5, 5, 8, 7, 7, 8, 4, 8, 5),
array(4, 5, 1, 6, 4, 6, 9, 3, 8, 1, 4, 5, 1, 6, 4, 6, 9, 3, 8, 1),
@alixaxel
alixaxel / longest_common_substring.php
Created July 9, 2012 03:06 — forked from chrisbloom7/longest_common_substring.php
Find the longest common substring in an array of strings (PHP)
<?php
function longest_common_substring($words)
{
$words = array_map('strtolower', array_map('trim', $words));
$sort_by_strlen = create_function('$a, $b', 'if (strlen($a) == strlen($b)) { return strcmp($a, $b); } return (strlen($a) < strlen($b)) ? -1 : 1;');
usort($words, $sort_by_strlen);
// We have to assume that each string has something in common with the first
// string (post sort), we just need to figure out what the longest common
// string is. If any string DOES NOT have something in common with the first
// string, return false.
@alixaxel
alixaxel / feistel.php
Created October 25, 2012 22:17 — forked from xeoncross/feistel.php
Feistel Hash
<?php
/**
* This function computes a hash of an integer. This can be used to not expose values to a customer, such as
* not giving them the id value for passing them to URLs. This algorithm is a bidirectional encryption (Feistel cipher) that maps
* the integer space onto itself.
*
* @link http://wiki.postgresql.org/wiki/Pseudo_encrypt Algorithm used
* @link http://en.wikipedia.org/wiki/Feistel_cipher Wikipedia page about Feistel ciphers
* @param int $value
* @return int