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
https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&grant_type=client_credentials |
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
$(document).ready(function() { | |
setHeight('.col'); | |
}); | |
var maxHeight = 0; | |
function setHeight(column) { | |
//Get all the element with class = col | |
column = $(column); | |
//Loop all the column | |
column.each(function() { |
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 isValidYoutubeURL($url) { | |
// Let's check the host first | |
$parse = parse_url($url); | |
$host = $parse['host']; | |
if (!in_array($host, array('youtube.com', 'www.youtube.com'))) { | |
return false; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
</head> | |
<body style="overflow: hidden;"> | |
<div id="fb-root"></div> | |
<script type="text/javascript"> |
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
svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm % |
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
$.validator.addMethod("phoneNumber", function(value, element) { | |
var filter = /^[0-9-+]+$/; | |
if (filter.test(value)) { | |
return true; | |
} | |
else { | |
return false; | |
} | |
}, "Please enter a valid phone number"); |
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
//Used for date difference calculations | |
function dateTimeDiff($date1, $date2) { | |
$alt_diff = new stdClass(); | |
$alt_diff->y = floor(abs($date1->format('U') - $date2->format('U')) / (60*60*24*365)); | |
$alt_diff->m = floor((floor(abs($date1->format('U') - $date2->format('U')) / (60*60*24)) - ($alt_diff->y * 365))/30); | |
$alt_diff->d = floor(floor(abs($date1->format('U') - $date2->format('U')) / (60*60*24)) - ($alt_diff->y * 365) - ($alt_diff->m * 30)); | |
$alt_diff->h = floor( floor(abs($date1->format('U') - $date2->format('U')) / (60*60)) - ($alt_diff->y * 365*24) - ($alt_diff->m * 30 * 24 ) - ($alt_diff->d * 24) ); | |
$alt_diff->i = floor( floor(abs($date1->format('U') - $date2->format('U')) / (60)) - ($alt_diff->y * 365*24*60) - ($alt_diff->m * 30 * 24 *60) - ($alt_diff->d * 24 * 60) - ($alt_diff->h * 60) ); | |
$alt_diff->s = floor( floor(abs($date1->format('U') - $date2->format('U'))) - ($alt_diff->y * 365*24*60*60) - ($alt_diff->m * 30 * 24 *60*60) - ($alt_diff->d * 24 * 60*60) - ($al |
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
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; |
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
<div id="fb-root"></div> | |
<script src="http://connect.facebook.net/en_US/all.js"></script> | |
<script> | |
FB.init({ | |
appId : 'ID_HERE', | |
status : true, // check login status | |
cookie : true, // enable cookies to allow the server to access the session | |
xfbml : true // parse XFBML | |
}); |
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
function validate_and_clean($value, $type = 'text') { | |
switch ($type) { | |
case 'text': | |
$value = filter_var($value, FILTER_SANITIZE_STRING); | |
$response = true; | |
break; | |
case 'email': | |
$value = filter_var($value, FILTER_SANITIZE_EMAIL); | |
if(filter_var($value01,FILTER_VALIDATE_EMAIL)) { |
NewerOlder