This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT zip, primary_city, | |
latitude, longitude, distance | |
FROM ( | |
SELECT z.zip, | |
z.primary_city, | |
z.latitude, z.longitude, | |
p.radius, | |
p.distance_unit | |
* DEGREES(ACOS(LEAST(1.0, COS(RADIANS(p.latpoint)) | |
* COS(RADIANS(z.latitude)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Display a histogram of WordPress option lengths, | |
-- with histogram buckets approximating the log of lengths, | |
WITH lengths AS ( | |
SELECT LENGTH(option_value) l, | |
autoload, | |
option_name | |
FROM wp_options | |
), | |
buckets AS ( | |
SELECT autoload, l, option_name, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Resultset to be JSON stringified and set back to client. | |
/// </summary> | |
[Serializable] | |
[SuppressMessage("ReSharper", "InconsistentNaming")] | |
public class DataTableResultSet | |
{ | |
/// <summary>Array of records. Each element of the array is itself an array of columns</summary> | |
public List<List<string>> data = new List<List<string>>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use static' | |
// noinspection JSUnusedLocalSymbols,JSUnusedGlobalSymbols | |
/** | |
* Tools for handling H.264 bitstream issues. | |
*/ | |
/** | |
* Handle the parsing and creation of "avcC" atoms. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/*globals ebml */ | |
if ( !window.ebml ) window.ebml = {}; | |
ebml.EbmlDecoder = function EbmlDecoder( options ) { | |
var schema = { | |
"80": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace OllieJones; | |
use ReflectionClass; | |
use ReflectionMethod; | |
/** | |
* Automatically register WordPress hooks in classes derived from this one. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/* | |
Queue.js | |
A class to represent a queue | |
Created by Kate Morley - https://code.iamkate.com/ - and released under the terms | |
of the CC0 1.0 Universal legal code: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
DROP FUNCTION IF EXISTS TRUNC_HOUR$$ | |
CREATE | |
FUNCTION TRUNC_HOUR(datestamp DATETIME) | |
RETURNS DATETIME DETERMINISTIC NO SQL | |
COMMENT 'returns current hour' | |
RETURN DATE_FORMAT(datestamp, '%Y-%m-%d %H:00')$$ | |
DROP FUNCTION IF EXISTS TRUNC_DAY$$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* this code examines a MP4 data stream. | |
* it looks at the appropriate atoms to determine width, height, and frame rate. | |
* | |
* It is a sleazy approach, the equivalent of grepping for necessary | |
* boxes rather than using box lengths to parse the file. | |
*/ | |
function read32( buff, fourcc, offset ) { | |
let start = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const crypto = require( 'crypto' ); | |
function validateGithub( secret, signature, rawBody ) { | |
if( (!signature) || signature.length === 0 ) return false; | |
if( (!rawBody) || rawBody.length === 0 ) return false; | |
try { | |
const splits = signature.split( '=' ); |
NewerOlder