Ensures a password has...
- One uppercase
- One lowercase
- One special character
- Two digits
- Length greater than 8
#!/usr/bin/python | |
import sys | |
if len(sys.argv) > 1: | |
file_name = sys.argv[1] | |
else: | |
print "no input file name" | |
exit() | |
from swf.movie import SWF |
<?php | |
######### router.php ######### | |
# | |
# This file implements basic server routing and rewrite rules; | |
# Run the following command from the project root: | |
# | |
# php -S localhost:5000 -t path/to/wordpress path/to/router.php | |
# | |
# ^ hostname ^ root ^ server router |
// Very simple regex that supports ```big code blocks```, | |
// `code highlights`, *bold*, _italic_ and ~strikethrough~, | |
// isolating each group. | |
/(`{3}([\S\s]+?)`{3})|(`(.+?)`)|(\*(.+?)\*)|(_(.+?)_)|(~(.+?)~)|(\n)|(.+?)/gm |
<?php | |
// Stirct types | |
function test(string $name, int $age, float $cuteness, bool $evil) { | |
//.... | |
} | |
// Convert types | |
function test((string)$name, (int)$age, (float)$cuteness, (bool)$evil) { | |
//.... |
/* | |
You can use this script with Google Swiffy to produce SVG frames from an SWF animation. | |
1. Upload your SWF file to Google Swiffy --> https://www.google.com/doubleclick/studio/swiffy/ | |
2. Save the swiffy output HTML page locally. | |
3. Edit the page to include this script with <script src="getSvgFrames.js"></script> | |
4. Open the page in Firefox to see the SVG download links appear for each frame. | |
*/ | |
(function(){ | |
var url = window.location.pathname; |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Sascha Depold http://depold.com | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
<?php | |
function add_cache($key, $value, $ttl) { | |
$dir = __DIR__.'/../cache/'; | |
// Remove slashes for security | |
$filename = $dir . str_replace('/', '', $key); | |
// Store expiry in first line | |
$lines = [(string)(time() + (int)$ttl), $value ]; | |
if (!file_exists($dir)) mkdir($dir, 0755, true); | |
file_put_contents($filename, implode("\n", $lines)); |
var util = require("util"); | |
function Thing() { | |
// The instance is also a proxy function for its __default method. | |
var instance = function() { | |
return instance.__default.apply(instance, arguments); | |
}; | |
// The instance needs to inherit from Thing.prototype. | |
instance.__proto__ = Thing.prototype; | |
// Initialize the instance with the __ctor method. |