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
var GoogleMap = (function() { | |
var instance = null; | |
function Constructor() { | |
var mapOpts = getDefaultMapOpts(); | |
var map = new google.maps.Map(document.getElementById("map"), mapOpts); | |
this.getMap = function() { | |
return map; | |
} | |
} |
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
/// <summary> | |
/// Convert a string to packed ascii byte array | |
/// </summary> | |
/// <param name="toBePacked">ascii string to be packed</param> | |
/// <returns>packed ascii byte array</returns> | |
public static byte[] PackAscii(string toBePacked) | |
{ | |
// convert the ascii to a byte array | |
byte[] ascii = System.Text.Encoding.ASCII.GetBytes(toBePacked.PadRight(8, ' ')); | |
List<byte> packedAscii = new List<byte>(); |
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
byte[] packedAscii = PackAscii("JOEY"); | |
for (int i = 0; i < packedAscii.Length; i++) | |
{ | |
requestData += packedAscii[i].ToString("X").PadLeft(2, '0'); | |
} |
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
"\e[1;5D": backward-word | |
"\e[1;5C": forward-word |
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
'.source.php': | |
'Formatted var_dump': | |
'prefix': 'pdd' | |
'body': 'echo \'<pre>\';\nvar_dump($1);\ndie();$0' |
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
{ | |
"vars": { | |
"@gray-darker": "lighten(#000, 13.5%)", | |
"@gray-dark": "lighten(#000, 20%)", | |
"@gray": "lighten(#000, 33.5%)", | |
"@gray-light": "lighten(#000, 60%)", | |
"@gray-lighter": "lighten(#000, 93.5%)", | |
"@brand-primary": "#0ebeef", | |
"@brand-success": "#5cb85c", | |
"@brand-info": "#5bc0de", |
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 | |
add_action( 'init', 'create_product_post_type' ); | |
function create_product_post_type() { | |
register_post_type( 'product', | |
array( | |
'labels' => array( | |
'name' => __( 'Products' ), | |
'singular_name' => __( 'Product' ) | |
), |
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 | |
function filter_search($query) { | |
if ( $query->is_search ) { | |
$query->set('post_type', array( 'post', 'product' ) ); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts', 'filter_search'); |
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 ( !is_admin() ) { | |
add_action( 'wp_enqueue_scripts', 'si_jquery_enqueue', 10 ); | |
} |
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 | |
function si_jquery_enqueue() { | |
wp_enqueue_script( 'jquery' ); | |
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '3.1.1', true ); | |
} |
OlderNewer