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
/**************************************************************************** | |
* | |
* 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 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
//calculate degrees | |
//the angle the circle is in relation to the center point | |
degrees = Math.round(radians*180/Math.PI); | |
//Calculcate Radians | |
//Radians specify an angle by measuring the length around the path of the circle. | |
radians = Math.atan2((mc.y), (mc.x)); | |
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
// Category: This is a free-form string used to categorise your events. | |
// Action: Another free-form string which represents the type of event, ex. “killed” and “game_start”. | |
// Label: This is an optional string parameter to the action. | |
// Value: This is an optional fractional number parameter to the action. | |
Application.ExternalCall("pageTracker._trackEvent", new object[] { category, action, label, value} ); |
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
FB.api({ method: 'pages.isFan', page_id: '{PAGE_ID}' }, function(response) { | |
if (response) { | |
alert("user has liked the page"); | |
} else { | |
alert("user has not liked the 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
$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; |
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
var myTimer:Timer = new Timer(5000,1); | |
myTimer.addEventListener(TimerEvent.TIMER, timerFunction); | |
function timerFunction(event:TimerEvent):void | |
{ | |
trace(“Timer function executed”); | |
} | |
myTimer.start(); |
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 | |
// Database credentials | |
define("DB_USER", "**************************"); | |
define("DB_PASS", "**************************"); | |
$staging = (strpos($_SERVER['REQUEST_URI'], "/dev/") !== false); | |
$localhost = (strpos($_SERVER['SERVER_NAME'], "localhost") !== false); | |
define("IS_STAGING", $staging); |
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 | |
$data = ''; | |
$errmsg = ''; // error message | |
$valid = false; // validation flag | |
$flag = array(); | |
$flag_class = ' class="formErrorInput"'; | |
// main logic |
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 sendEmail($message){ | |
global $data; | |
$email = $data['email']; | |
$name = $data['fname']; | |
// getting the email copy |
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 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 | |
} |