Skip to content

Instantly share code, notes, and snippets.

View ao's full-sized avatar
😶‍🌫️

Andrew O ao

😶‍🌫️
View GitHub Profile
@ao
ao / crc32test.php
Created August 21, 2014 09:44
crc32test.php - Calculate crc32 loss
<?php
ini_set('memory_limit', '16000M');
$arrays = array();
$total = 50000000;
for ($i=0; $i<$total; $i++) {
$arrays[crc32($i)] = '';
<?php
function fch($csm)
{
if($csm < 0)
$csm += 4294967296.0;
$a = (int)fmod($csm, 10);
$t = 1;
$b = (int)($csm / 10);
@ao
ao / README.md
Created April 15, 2014 13:24 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@ao
ao / gist:2b6ca4a4df66fe48b7a6
Created December 18, 2013 11:56
AngularJS - Get parent scope!
var scope = angular.element(document).scope();
@ao
ao / gist:c793ffaf52c60e041927
Created October 17, 2013 14:17
speedtest from commandline
wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip