Skip to content

Instantly share code, notes, and snippets.

Verifying my Blockstack ID is secured with the address 1KfdWMJuVKdLB2eCLXNxnkmU1TmdzC9rfM https://explorer.blockstack.org/address/1KfdWMJuVKdLB2eCLXNxnkmU1TmdzC9rfM
var view = new View();
view.width = 1024;
view.height = 768;
view.render();
@kirkouimet
kirkouimet / php-analytics.php
Created November 14, 2011 04:17
PHP analytics function
function getAnalytics() {
$user = $_SERVER['HTTP_USER_AGENT'];
$browser = 'Unknown';
$platform = 'Unknown';
$version= '';
// First get the platform?
if(preg_match('/linux/i', $user)) {
$platform = 'Linux';
}
@kirkouimet
kirkouimet / OrderIdentifierGenerator.js
Last active May 5, 2023 16:30
Generate an easy to communicate order identifier with a check digit with a keyspace in the trillions
class OrderIdentifierGenerator {
static characters = '234567CDFGHJKLMNPQRTVWXYZ';
// Generate a new identifier
static generate() {
const partialIdentifier = OrderIdentifierGenerator.generatePartialIdentifier();
let identifier = (
partialIdentifier.slice(0, 3) +