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
const util = require('util') | |
const mapString = ` | |
#.######################################################################################################################## | |
#<^vvv<v^v>^vvv.v<vv<>^^<^><.vvv^>v<^<<<<^>^vv^>^<^>>v>v^v^>^v>vv>^.^..v<^<^^^>>>><<>v<^^^v<>>><>.vv^vv>v.vv<<^<.v...^v.<# | |
#<^^><><^^^<^>>v^^>v<^vvvv><vv<v.<vv^v<>v^.v^>v^v<>^<>^<vv.v^.^<<<^^^..<.><<v<vv^<v^^>>.><v<vv.>v>><<v.v^<^<v^^^^vv^v>^v># | |
#<^.>>v<<vv^^<<<<<.<v<>^>v^v<v<<<^<v^<<vvvv>v<^v<^v<>v.<>v^^^.^vv.<vv>v<^^v^>>.><^.><<<>v^>><^.<><>v^vv>>^v>>.><vvv^<<>v<# | |
#>v^v<>^<.^.^>><>>..<vv<>^>>vv<.<.<^v<^<>>><<^v.v^<v<vv><v.<v.>v^v^<.v>^v^<^.v>.v.>^<v^>vv><<v.>^>v><<^vv<v^>v>v>.>v>>><.# | |
#><<<^<v.><>>^>v<^><^<^v.^v<vv<<^^vvv><^^>>>>v^.^^v^<v^^.vv^v^<.v<v^^v<^..>>v<^v^.v^^^^.>v^<vv^<<>><<>vv><^<<^^><..vv.v^.# | |
#<^>^.^v.><^>.v<v<>^<^<<<<<^^><vv.>^v><^<.>>.><^<v>>>^^^vvv<>v^^^<.^v^<^v<v>^.^.<>v^.v>v<v^<^^vv.^<><>v^>>.^>>><>><>v..^<# |
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 list = ['SoMe', 'hUgE', 'aRrAy', '...']; | |
// Helper functions | |
function reverseText(text) { | |
// A | |
// big | |
// chunk | |
// of | |
// code |
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 list = ['some', 'huge', 'array', '...']; | |
function reverseAndCapitalizeOrLowercase(list) { | |
list.forEach(function(text) { | |
// A | |
// big | |
// chunk | |
// of | |
// code |
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_shortcode( 'ssn', 'esw_custom_ssn' ); | |
/** | |
* Emulate Simple Section Nav for a specific parent post/page. | |
* | |
* Example: [ssn ancestor="ancestor_id" parent="parent_id" depth="depth"] | |
* | |
* @since 1.0.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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
add_filter( 'page_attributes_dropdown_pages_args', 'my_slug_show_all_parents' ); | |
add_filter( 'quick_edit_dropdown_pages_args', 'my_slug_show_all_parents' ); | |
/** | |
* Show all parents, regardless of post status. | |
* | |
* @since 1.0.0 | |
* | |
* @param array $args Original get_pages() $args. | |
* | |
* @return array $args Args set to also include posts with pending, draft, and private status. |
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
/** | |
* Equal Heights Plugin | |
* | |
* Equalize the heights of elements. Great for columns or any elements | |
* that need to be the same size (floats, etc). | |
* | |
* Based on Rob Glazebrook's (cssnewbie.com) script | |
* | |
* Additions | |
* - ability to include a break point (the minimum viewport width at which the script does anything) |
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
// Only override the title on the front-end. | |
if ( ! is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { | |
add_filter( 'the_title', 'PREFIX_override_post_title', 10, 2 ); | |
} | |
/** | |
* Override the_title() with a custom field if it is specified. | |
* | |
* @param string $title Original post title. | |
* | |
* @return string $title Update post title. |
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
/** | |
* Wrap elements in a set number of container elements with specific classes. | |
* | |
* Example Usage: wrap every 3 <li> elements within a <div class="col"></div> | |
* jQuery('li').dividize(3, 'div', 'col'); | |
* | |
* @param int columnNumber Number of columns. | |
* @param string wrapperElement The wrapper container (e.g. div, span). | |
* @param string className Class to add to the wrapper containers. | |
* |