This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 makeSQLsafe($sql_input) { | |
| $sql_input = str_replace("'","\\'",stripslashes($sql_input)); | |
| $sql_input = str_replace('"','\\"',$sql_input); | |
| $sql_input = str_replace(';','\\;',$sql_input); | |
| //$sql_input = str_replace('%','\\%',$sql_input); | |
| //$sql_input = str_replace('_','\\_',$sql_input); | |
| $sql_input = str_replace("&","&\\;",$sql_input); | |
| $sql_input = str_replace("<","<\\;",$sql_input); | |
| $sql_input = str_replace(">",">\\;",$sql_input); |
This file contains hidden or 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 sqlURL($sql_input) { | |
| $res = parse_url($sql_input); | |
| if(!isset($res['scheme'])) { | |
| $sql_input = "http://".$sql_input; | |
| } | |
| $sql_input = str_replace("'","\'",stripslashes($sql_input)); |
This file contains hidden or 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 hidden or 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
| @current_app.before_request | |
| def detect_ie_browser(): | |
| """Redirect all IE visitors to a special page | |
| informing them to get a web browser. | |
| """ | |
| # For this to work, the following conditions must be met: | |
| # 1. The visitor is using IE (doesn't matter what version) | |
| # 2. We must not be currently requesting a static file | |
| # (we still need page styles/resources to load) | |
| # 3. We don't need to be directly requesting the special page |
This file contains hidden or 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
| export function find_parent(element, selector) { | |
| // The desired element was not found on the page | |
| if (element === null) { | |
| return null; | |
| } | |
| // We found the desired element | |
| if (element.matches(selector)) { | |
| return element; |
This file contains hidden or 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
| # Get a link to the root AppData folder | |
| $appdata = $(Join-Path -Path $(Resolve-Path ~) -ChildPath "AppData") | |
| Write-Host "Searching for Normal.dotm in $($appdata)" | |
| Write-Host "This may take some time..." | |
| # Search for the Normal.dotm file | |
| $results = Get-ChildItem -Path $appdata -Filter Normal.dotm -Recurse -ErrorAction SilentlyContinue -Force | |
| # It found the file | |
| if ($results -ne $null) { |