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
""" | |
LEGO Backlot dummy server. | |
Used to save/load player progress. | |
Original PHP code by JrMasterModelBuilder. | |
Ported to Python by le717. | |
""" | |
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 | |
function valid_cc_expire_format($val) { | |
return (bool) preg_match('/\d{2}\/\d{4}/', $val); | |
} | |
function valid_cc_expire_value($val) { | |
$currentMonth = intval(date('n')); | |
$currentYear = intval(date('Y')); | |
$r = preg_match('/(\d{2})\/(\d{4})/', $val, $matches); |
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
<script type="text/javascript"> | |
var iframe = document.createElement("iframe"); | |
iframe.height = "1px"; | |
iframe.width = "1px"; | |
iframe.id = "ads-text-iframe"; | |
iframe.src = "/adframe.js"; | |
document.body.appendChild(iframe); | |
var a = [ | |
"In a world free from ads, one font reigns supreme. COMIC SANS!", |
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 | |
/** | |
* Convert a date to the "American" date format. | |
* | |
* While one may assume this function appropriately rearranges the | |
* date format to follow the American MM/DD/YYYY format, in reality | |
* and by intention, this function is very naive. All it does is replace | |
* all dashes and periods with a forward-slash, preserving all ordering | |
* and leaving that up to the caller. | |
* This behavior is to allow PHP to correctly parse dates in the American |
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
from bpy.props import StringProperty | |
from bpy_extras.io_utils import ImportHelper | |
class LDRImporterOps(bpy.types.Operator, ImportHelper): | |
"""LDR Importer Operator""" | |
bl_idname = "import_scene.ldraw" | |
bl_description = "Import an LDraw model (.ldr/.dat)" | |
bl_label = "Import LDraw Model" |
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
/* | |
Created 2013 Triangle717 | |
<http://Triangle717.WordPress.com/> | |
Please contact me at the address above if | |
you use this script in any of your work. :) | |
*/ | |
// Object containing the game names and acronyms |
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 | |
if (PHP_OS == 'WIN32' || PHP_OS == 'WINNT') { | |
define('EOL', "\r\n"); | |
} else if (PHP_OS == 'Linux') { | |
define('EOL', "\n"); | |
} else { | |
define('EOL', "\n"); | |
} | |
?> |
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
def circle_info(Peri, Area): | |
if select == "Area": | |
area_of_circle(rad) | |
elif select == "Peri": | |
peri_of_circle(rad) | |
else: | |
print("Sorry, invalid selection.") | |
def area_of_circle(rad): | |
return (3.14 * (rad ** 2)) | |
def peri_of_circle(rad): |
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
class SOPOMessages: | |
def __init__(self): | |
self.__encodeLegend = {} | |
self.__decodeLegend = {} | |
# Only decode the legends once per instance | |
# We only need to check if the encoding legend is generated | |
# for both legends are generated at the same time | |
if len(self.__encodeLegend) == 0: |