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
# run the adb shell | |
adb shell | |
# basic recording from shell | |
screenrecord --verbose /sdcard/nexus5.mp4 | |
# press Ctrl-C to stop | |
# recording for 30 seconds | |
screenrecord --verbose --time-limit 30 /sdcard/nexus5.mp4 | |
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
if ( strstr( $_SERVER['HTTP_USER_AGENT'], 'facebookexternalhit' ) { | |
// show OpenGraph headers for page | |
} else { | |
// Password protected page / login 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
# load helper manually | |
$this->load->helper('form'); | |
# create form | |
echo form_open( base_url( 'login' ), array( 'id' => 'login-form', 'class' => 'login' ) ); |
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
<form action="http://testapplication.com/login" method="post" accept-charset="utf-8" id="login-form" class="login"> | |
<div style="display:none"> | |
<input type="hidden" name="csrf_test_name" value="80bfb80b356d6d31f4ce4dad0c6cf69e"> | |
</div> | |
... | |
... | |
</form> |
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
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>"> |
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
<!-- add to HEAD --> | |
<script type="text/javascript"> | |
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>'; | |
</script> | |
<!-- Update AJAX code, change csrf_test_name as needed --> | |
<script type="text/javascript"> | |
$.post( ajax_url, { data: 'value', 'csrf_test_name': csrf_value }, function( response ) { | |
// response | |
}, 'json' ); |
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
<!-- create form with open_form() --> | |
<form action="http://testapplication.com/login" method="post" accept-charset="utf-8" id="login-form" class="login"> | |
<div style="display:none"> | |
<input type="hidden" name="csrf_test_name" value="80bfb80b356d6d31f4ce4dad0c6cf69e"> | |
</div> | |
... | |
... | |
</form> | |
<!-- Update AJAX code to post serialized data --> |
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 | |
// remove WordPress items from toolbar | |
function preload_my_toolbar() { | |
global $wp_admin_bar; | |
// remove WordPress logo | |
$wp_admin_bar->remove_node('wp-logo'); | |
// remove search button |
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 | |
/** | |
* @package MyToolbar | |
*/ | |
/* | |
Plugin Name: MyToolbar | |
Plugin URI: http://www.webniraj.com | |
Description: This plugin creates a custom toolbar | |
Version: 1.0 |