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 countAdjacentPairs(search_string) { | |
var words_that_appeared_in_adjacent_pairs = []; | |
sets_of_two_adjacent_words_in( search_string ).forEach( function( two_adjacent_words ) { | |
var first_of_the_two_words = two_adjacent_words[ 0 ]; | |
if ( | |
two_adjacent_words.are_a_pair() | |
&& first_of_the_two_words.is_not_one_of( words_that_appeared_in_adjacent_pairs ) | |
) { | |
// which one reads more naturally? |
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 break_into_words( text ) { | |
return text.split( ' ' ).filter( function(word) { return word !== ''; } ); | |
} | |
function add( element, to_array ) { | |
to_array.push( element ); | |
} | |
function space_separated( array ) { | |
return array.join( ' ' ); |
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 | |
/** | |
* Plugin Name: My custom Gravity form submission processing plugin | |
*/ | |
// We will use photo contest entry submissions as the example | |
when_a_gravity_form_is_submitted( 'check_whether_it_is_a_contest_entry_submission' ); | |
when_a_contest_entry_is_submitted( 'do_some_custom_processing' ); |
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
when_the 'page_loads', -> | |
display_weather_analysis_map() | |
enable_changing_display_option_by_clicking_display_options() | |
enable_navigating_map_by_using_search() | |
display_weather_analysis_map = -> | |
when_the 'current_station_info_is_available', -> | |
show_map "analysis-map", false | |
show_what_station_is_being_shown() |
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 | |
/* | |
* This code implements a simple higher/lower guessing game. | |
* | |
* The computer picks a random number and the user guesses by way of an HTML form. | |
* | |
* The user is given hints if they guess incorrectly with the ability to try again. | |
* | |
* Upon winning the game the user can add their name to a session-based leaderboard. | |
*/ |
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 ( Yii::app()->user->hasFlash( 'changePassword' ) ): ?> | |
.flash-success | |
p style="color:red;" | |
<?php echo Yii::app()->user->getFlash( 'changePassword' );?> | |
<?php endif ?> |
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
def test_html_unescaped_php_tags | |
source = %q{ | |
a href="<?php echo $url ?>" | |
} | |
assert_html '<a href="<?php echo $url ?>"></a>', source | |
end |
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 | |
/* | |
* Plugin Name: Disabling autocomplete for editor | |
* Description: See https://core.trac.wordpress.org/ticket/28037 | |
*/ | |
add_action( 'post_edit_form_tag' , 'disable_autocomplete_for_editor__gfm_ac' ); | |
function disable_autocomplete_for_editor__gfm_ac( ) { | |
echo ' autocomplete="off" '; |
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
thereAreNo = ( items_in_array ) -> | |
items_in_array.length == 0 | |
module.tests.thereAreNo: () -> | |
assert thereAreNo [] | |
assert.fail thereAreNo [ 1 ] | |
assert.throws -> | |
thereAreNo 1 | |
, /is not an array/ |
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
" a particular style of auto-indentation | |
set si | |
" I like these colors | |
syntax enable | |
set background=dark | |
colorscheme fruit "https://github.com/flazz/vim-colorschemes/blob/master/colors/fruit.vim | |
" create .swp temp files in my home dir instead of in the current directory | |
set directory=~/.vimtmp |
OlderNewer