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 | |
// Turn off magic_quotes_runtime | |
if (get_magic_quotes_runtime()) | |
@ini_set('magic_quotes_runtime', false); | |
// Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled) | |
if (get_magic_quotes_gpc()) | |
{ | |
function stripslashes_array($array) | |
{ |
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
function format_meters(m) { | |
if(m > 1000) | |
return (Math.round(m)/1000)+"km"; | |
else if(m < 1) | |
return (Math.round(m*1000*1000)/1000)+"cm"; | |
else | |
return (Math.round(m*1000)/1000)+"m"; | |
} |
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
function konami(cb) { | |
var code = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65]; | |
var pos = 0; | |
document.onkeydown = function(e) { | |
if(code[pos] === e.which) { | |
if(++pos >= code.length) { | |
if(typeof cb == String.fromCharCode(102,117,110,99,116,105,111,110)) | |
cb(); | |
pos = 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
` | |
// BigInt.js - Arbitrary size integer math package for JavaScript | |
// Copyright (C) 2000 Masanao Izumo <[email protected]> | |
// Version: 1.0.1 | |
// Licence: GPL | |
// | |
// This program is free software; you can redistribute it and/or modify | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation; either version 2 of the License, or | |
// (at your option) any later version. |
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> | |
/// 10^0..10^8 (NumDigits used in the HOTP) | |
/// </summary> | |
private static readonly int[] DigitsPower = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000}; | |
private static int DynamicTruncate(byte[] hash) | |
{ | |
int offset = hash[hash.Length - 1] & 15; | |
return ((hash[offset] & 127) << 24) + ((hash[offset + 1] & 255) << 16) + ((hash[offset + 2] & 255) << 8) + |
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 | |
class LuaParseError extends Exception {} | |
class LuaParser { | |
private $source; | |
private $source_len; | |
private $offset = 0; | |
private $line = 1; |
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
local E, L, V, P, G, _ = unpack(select(2, ...)); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore | |
local DT = E:GetModule('DataTexts') | |
-- localized references for global functions (about 50% faster) | |
local join = string.join | |
local format = string.format | |
local find = string.find | |
local gsub = string.gsub | |
local sort = table.sort | |
local ceil = math.ceil |
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
local D0 = {9,6,1,3,0,4,5,7,8,2} | |
local function D_next(D) | |
local Dn = {} | |
for i = 1, #D do | |
Dn[i] = (D[i] + 1) % 10 | |
end | |
return Dn | |
end |
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
/* | |
Copyright (c) 2014 Bastien Clément | |
Permission is hereby granted, free of charge, to any person obtaining a | |
copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: |
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
var ip = require('ip'); | |
console.time("load"); | |
var list = require("./bt_level1.js").map(function(block) { | |
try { | |
block.start = ip.toLong(block.start); | |
block.end = ip.toLong(block.end); | |
} catch(e) { | |
console.log(e, block); | |
process.exit(0); |
OlderNewer