This is a series of MATLAB style relational operators for Handlebars.
- eq - equal to
- ne - not equal to
- lt - less than
- gt - greater than
/**************************************************************************** | |
* | |
* DirectInput keyboard scan codes | |
* | |
****************************************************************************/ | |
#define DIK_ESCAPE 0x01 | |
#define DIK_1 0x02 | |
#define DIK_2 0x03 | |
#define DIK_3 0x04 | |
#define DIK_4 0x05 |
This is a series of MATLAB style relational operators for Handlebars.
body.loading:after { | |
/* with no content, nothing is rendered */ | |
content: ""; | |
position: fixed; | |
/* element stretched to cover during rotation an aspect ratio up to 1/10 */ | |
top: -500%; | |
left: -500%; | |
right: -500%; | |
bottom: -500%; | |
z-index: 9999; |
// Unique ID generator, based on date | |
uniq_id = require('crypto'). | |
createHash('md5'). | |
update("" + (new Date()).getTime()). | |
digest("hex"); |
<?php | |
function encryptPassword($value){ | |
if(!$value){return false;} | |
$text = $value; | |
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); | |
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); | |
$crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, SECRET_KEY, $text, MCRYPT_MODE_ECB, $iv); | |
return trim(base64_encode($crypttext)); //encode for cookie | |
} |
var target : Transform; | |
var damping = 6.0; | |
var smooth = true; | |
@script AddComponentMenu("Camera-Control/Smooth Look At") | |
function LateUpdate () { | |
if (target) { | |
if (smooth) | |
{ |
$sql = safeInput("UPDATE table_name SET field_one='%s', field_two='%s' WHERE id='%s'", $input); | |
function safeInput($string, $args){ | |
foreach( $input as $key => $value ){ | |
// 'clean' the input | |
$args[$key] = mysql_real_escape_string($value); | |
} | |
// add the statement as the first element of the array | |
$args[0] = $string; |
function uniqueCode(){ | |
var characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
var ticks = (new Date()).getTime().toString(); | |
var code = ""; | |
for (var i = 0; i < characters.length; i += 2) { | |
if ((i + 2) <= ticks.length) { | |
var number = parseInt(ticks.substr(i, 2)); | |
if (number > characters.length - 1) { | |
var one = number.toString().substr(0, 1); | |
var two = number.toString().substr(1, 1); |
_.mixin({ | |
// - Checks if a string is in an Array | |
// Source: https://gist.github.com/tracend/570113fcb329aaf69bf0 | |
inArray: function(value, array){ | |
// if not an array just output false | |
return ( array instanceof Array ) ? (array.indexOf(value) > -1) : false; | |
} | |
}); |