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
| { | |
| "always_show_minimap_viewport": true, | |
| "bold_folder_labels": true, | |
| "caret_extra_bottom": 1, | |
| "caret_extra_top": 1, | |
| "caret_extra_width": 1, | |
| "caret_style": "blink", | |
| "color_scheme": "Packages/Boxy Theme/schemes/Boxy Monokai.tmTheme", | |
| "fade_fold_buttons": false, | |
| "font_face": "hermit", |
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
| <script type="text/javascript"> | |
| (function(){ | |
| var s = document.createElement('script'); | |
| s.type = 'text/javascript'; | |
| a.async = true; | |
| s.src = ''; | |
| var x = document.getElementsByTagName('script')[0]; | |
| x.parentNode.insertBefore(s, x); | |
| })(); | |
| </script> |
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 slugify( $str ) { | |
| $new_str = $str; | |
| $new_str = preg_replace('/ /', '-', $new_str); | |
| $new_str = preg_replace('/[^A-Za-z0-9\-]/', '', $new_str); | |
| $new_str = strtolower($new_str); | |
| return $new_str; | |
| } |
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 lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>MC TEST</title> | |
| </head> | |
| <body> | |
| <?php | |
| define('CLIENT_ID', ''); |
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 generate_awesome_excerpt( $id, $character_limit, $ending ) { | |
| if( gettype($character_limit) != 'integer' ) { | |
| $character_limit = 100; | |
| } | |
| $post = get_post($id); | |
| $content = $post->post_content; |
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
| #!/bin/bash | |
| BUCKET_NAME=${1-''} | |
| # Get upload folder path using WP-CLI | |
| # We use --url=http://blah.com in our WP-CLI commands so that we don't get the PHP warning about HTTP_HOSTS | |
| UPLOADS_PATH=$(wp eval '$upload_dir = wp_upload_dir(); echo $upload_dir["basedir"];' --url=http://blah.com 2>&1) | |
| if [[ $UPLOADS_PATH =~ Error ]] | |
| then |
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 get_post_meta_object( $id ) { | |
| $object = new stdClass(); | |
| $meta = get_post_meta( $id ); | |
| foreach( $meta as $key => $value ) { | |
| $object->{$key} = $value[0]; | |
| } |
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 superConsoleLog( arg ) { | |
| console.time( arg ); | |
| console.profile( arg ); | |
| console.assert( arg ); | |
| console.count( arg ); | |
| console.debug( arg ); | |
| console.dir( arg ); | |
| console.dirxml( arg ); | |
| console.error( arg ); | |
| console.info( arg ); |
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 | |
| /* | |
| * | |
| * Get posts with a standard query | |
| * Include all the meta data in the result | |
| * | |
| */ | |
| function get_posts_with_meta( $args ) { | |
| $query = get_posts($args); |
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 scroll position in all IE9+ Firefox, Chrome, and Edge | |
| var scrollTop = 0; | |
| window.addEventListener('scroll', function(e){ | |
| scrollTop = document.documentElement.scrollTop || window.scrollY; | |
| }); |