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
Apache Error Log - /usr/local/apache/logs/error_log | |
cPanel Error Log - /usr/local/cpanel/logs/error_log | |
MySQL Error Log - /var/lib/mysql/FULLSERVERHOSTNAME.err | |
Exim Main Log - /var/log/exim_mainlog | |
FTP ERROR LOG - /var/log/messages |
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
//The following FQL get's events attached to a page. But it could be any FQL query. | |
var Q = "SELECT eid, name, description, pic_big, start_time, end_time, location FROM event WHERE creator = PAGE_ID AND eid IN (SELECT eid FROM event_member WHERE uid = PAGE_ID)"; | |
FB.api("/fql?q=" + encodeURIComponent(Q), function(response) { | |
console.log(response); | |
}, 'get', { | |
access_token: 'GENERATED_APP_ACCESS_TOKEN' | |
}); |
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
function share_image(img_url, text) { | |
//Check to see if the user has authenticated the App. | |
FB.getLoginStatus(function(response) { | |
if (response.status === 'connected') { | |
//If you want the user's Facebook ID or their access token, this is how you get them. | |
var uid = response.authResponse.userID; | |
var access_token = response.authResponse.accessToken; | |
do_api_share(access_token, img_url, text); |
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 | |
if ( isset( $_SERVER['HTTP_ORIGIN'] ) && stristr( $_SERVER['HTTP_ORIGIN'], 'apps.facebook.com' ) ) { | |
echo("<script> top.location.href='" . c_i( 'fb_tab_url' ) . "'</script>"); | |
} |
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
FB.Event.subscribe('edge.create', function(targetUrl) { | |
_gaq.push(['_trackSocial', 'facebook', 'like', targetUrl]); | |
}); | |
FB.Event.subscribe('edge.remove', function(targetUrl) { | |
_gaq.push(['_trackSocial', 'facebook', 'unlike', targetUrl]); | |
}); | |
FB.Event.subscribe('message.send', function(targetUrl) { | |
_gaq.push(['_trackSocial', 'facebook', 'send', targetUrl]); |
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 | |
/** | |
@uses CodeIgniter 2.1 | |
Grab the user's language from the HTTP_ACCEPT_LANGUAGE string. | |
*/ | |
if ( isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) { |
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
Get IP add of server Ubuntu 12.04 - ifconfig eth0 | grep inet | awk '{ print $2 }' |
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 | |
if( isset($_GET['username']) ){ | |
$user = mysql_real_escape_string( strip_tags( $_GET['username'] )); | |
$ext = ''; | |
echo "<p>"; | |
for( $i = 1; $i<100; $i++ ){ | |
if( $i>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
sudo htpasswd /etc/subversion/passwd second_user_name |
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 | |
//http://sivel.net/2009/10/wordpress-maintenance-mode-without-a-plugin-part-3/ | |
function is_user_logged_in() { | |
$loggedin = false; | |
foreach ( (array) $_COOKIE as $cookie => $value ) { | |
if ( stristr($cookie, 'wordpress_logged_in_') ) | |
$loggedin = true; | |
} | |
return $loggedin; | |
} |