Skip to content

Instantly share code, notes, and snippets.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
var alphabet = 'ABCDEFGHJKMNPQRVWXY0123456789';
var base = alphabet.length;
function calculate_tt(lat, lon) {
lat += 90.0;
lon += 180.0;
lat *= 10000.0;
lon *= 10000.0;
@alixaxel
alixaxel / unresponsive.css
Last active December 29, 2022 03:57
Bootstrap Unresponsive Override
body.unresponsive {
min-width: 960px;
}
body.unresponsive .container {
max-width: none !important;
width: 960px !important;
}
body.unresponsive [class^="col-"] {
float: left;
}
@alixaxel
alixaxel / requirements.tsv
Last active August 29, 2015 14:02
Requirements Metadata for Compliance Chimp
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 4 columns, instead of 1 in line 1.
Requirement Priority SAQ Bitmask Validation
----------------------------------------------------------
1.1 6 000000011 N
1.1.1.a 6 000000011 C
1.1.1.b 6 000000011 N
1.1.1.c 6 000000011 N
1.1.2.a 1 000010011 Y
1.1.2.b 1 000010011 Y
1.1.3 1 000000011 C
1.1.4.a 2 010010011 N

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

/*
* 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
@alixaxel
alixaxel / sqlite.udf.like.icu.php
Last active September 22, 2021 19:03
SQLite UDFs for LIKE Operator Overloading
<?php
$db->sqliteCreateFunction('like',
function ($pattern, $data, $escape = null) use ($db)
{
static $modifiers = null;
if (isset($modifiers) !== true)
{
$modifiers = ((strncmp($db->query('PRAGMA case_sensitive_like;')->fetchColumn(), '1', 1) === 0) ? '' : 'i') . 'suS';
@alixaxel
alixaxel / spl_autoload.php
Created May 23, 2013 20:30
Lightweight, PSR-0 compliant SPL Autoloader
<?php
$paths = array
(
__DIR__ . '/vendor/',
__DIR__ . '/vendor/phunction/phunction.php',
);
foreach ($paths as $path)
{
@alixaxel
alixaxel / daveBox.sh
Last active December 17, 2015 11:49
Post-install script for (X)Ubuntu 13.04 (Raring) Desktop Edition
#!/bin/bash
# CC0 License
# http://creativecommons.org/publicdomain/zero/1.0/
#
# daveBox 0.1.1 (gist.github.com/alixaxel/5605638)
# Copyleft (c) 2013 Alix Axel <[email protected]>
clear && echo -e "\e[1;31mdaveBox 0.1.1\e[0m\n"
<?php
/**
* The MIT License
* http://creativecommons.org/licenses/MIT/
*
* Tidy Wrapper for HTML 5 Indentation
* Copyright (c) 2013 Alix Axel <[email protected]>
**/