Skip to content

Instantly share code, notes, and snippets.

View shadda's full-sized avatar
💭
Freaking out in a moon-age daydream, oh yeah.

Matt Wilson shadda

💭
Freaking out in a moon-age daydream, oh yeah.
View GitHub Profile
(function($, window, document)
{
'use strict'
var _pad = function(num, size)
{
var s = num + '';
while (s.length < size) s = '0' + s;
return s;
}
GET / HTTP/1.1
HTTP/1.1 200 OK
Date: Sun, 26 Jan 2014 09:41:59 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=28a55acac0720fc9:FF=0:TM=1390729319:LM=1390729319:S=9OsUkJits0D8149k; expires=Tue, 26-Jan-2016 09:41:59 GMT; path=/; domain=.google.com
Set-Cookie: NID=67=VTiB736MieNBO-Dc1t4LaUZVFxA1mZmPRIxIeA1d-zF7mDV5VbZF9Ji3wp3IfH4YUq61clqgpsBKNnLhKEKUOoNj0HIzHDQjkgeK2_cOEeGck0RorFtZO30H7vKapjyH; expires=Mon, 28-Jul-2014 09:41:59 GMT; path=/; domain=.google.com; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
mysql> select state from client_information;
+---------+
| state |
+---------+
| KS |
| KS |
| KS |
| KS |
| MO |
| GA |
# Do not change tags in here without changing every other reference to them.
# If adding new technology, make sure they are uniquely named.
# Armies get a combined arms bonus when the ratio cav / (inf+cav) is _less_ than "cav_to_inf_ratio". This applies for the "unit_type" of a country.
#groups must be defined BEFORE tables.
groups = {
nomad_group = {
<?php
public static function Coalesce(&$value, $ifnull=null)
{
if(empty($value))
{
return $ifnull;
}
return $value;
}
import sys, os
import time
import pytz
import math
import traceback
import re
import eventlet
from datetime import datetime
from eventlet import GreenPool
import pycurl
<?php
class Tools
{
const DEFAULT_DATE_FORMAT = DATE_ATOM;
public static function Coalesce(&$value, $ifnull=null)
{
if(empty($value))
{
(function()
{
TILES = {};
SELECTED_TILES = [];
INVALIDATED_TILES = {};
$stage = $('#stage');
$MAP_TILE_RADIUS = 22;
$MAP_TILE_HEIGHT = parseInt($MAP_TILE_RADIUS * Math.sqrt(3));
$REDRAW = true;
<?php
class XD extends \DOMDocument
{
public function __construct($version = '1.0', $encoding = 'UTF-8')
{
parent::__construct($version, $encoding);
$this->registerNodeClass('DOMElement', 'XE');
}
}
<?php
class TileMaker
{
public static function getDataPool($data, $max_entries)
{
$len = count($data);
$results = array();
if($len >= $max_entries)