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
# @author David Wortham <djwortham+programming@gmail.com> | |
# @date 2011-04-30 | |
# @license MIT License: http://www.opensource.org/licenses/mit-license.php | |
def isPalendrome(number) | |
numberStr = number.to_s() | |
return false if numberStr.empty? || numberStr.length < 0 | |
return true if numberStr.length < 2 | |
lCursor = 0 | |
rCursor = numberStr.length - 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
# @author David Wortham <djwortham+programming@gmail.com> | |
# @date 2011-04-30 | |
# @license MIT License: http://www.opensource.org/licenses/mit-license.php | |
def factorize(input) | |
remainingInput = input | |
factors = {} | |
i = 2 | |
while i <= remainingInput | |
while remainingInput % i == 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
# @author David Wortham <djwortham+programming@gmail.com> | |
# @date 2011-04-30 | |
# @license MIT License: http://www.opensource.org/licenses/mit-license.php | |
# isPrime | |
# Function to detect if the input (asserted Fixednum) is a prime number | |
# uses an optional cache (asserted Hash) to speed up subsequent calls | |
def isPrime(number, cache) | |
return false if number < 1 | |
return true if number == 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
#!/usr/bin/env php | |
<?php | |
$output = array(); | |
$errorOutput = array(); | |
$return = 0; | |
$pathToErrorFile = 'temp/minify_errors.txt'; | |
file_put_contents($pathToErrorFile, ''); | |
exec('git rev-parse --verify HEAD 2> /dev/null', $output, $return); | |
$against = $return == 0 ? 'HEAD' : '4b825dc642cb6eb9a060e54bf8d69288fbee4904'; |
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 | |
/** | |
* \DJW\BBCode | |
* A BBCode translation class | |
* Uses OWASP cheatsheet to prevent XSS | |
* @see https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet | |
* | |
* @author CarbonPhyber | |
*/ | |
namespace DJW; |
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 | |
/** | |
* Unit Tests for BBCode parser | |
* Uses OWASP cheatsheet to prevent XSS | |
* @see https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet | |
* | |
* @author CarbonPhyber | |
*/ | |
require dirname(dirname(dirname(__FILE__))) . '/private/common.php'; |
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
package main | |
import ( | |
"net/http" | |
"./muxtester" // this is our router library. the "muxtester" dir should be in the same directory as this "main.go" | |
) | |
func main() { | |
http.HandleFunc("/", muxtester.HandleCatchall) | |
http.ListenAndServe("localhost:8080", nil) |
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"; | |
var tests = { | |
"$0.41": 0.41, | |
"$12,345.67": 12345.67, | |
"$1m": 1000000, | |
"$32b": 32000000000, | |
"$0.2t": 200000000000 | |
}; |
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
*/ | |
'use strict'; | |
var React = require('react-native'); | |
var WebViewBridgeNative = require('react-native-webview-bridge'); | |
var { |
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
alert('xss!'); |
OlderNewer