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: Plugin name | |
*/ | |
add_action( 'wp_enqueue_scripts', 'enqueue_scripts__pluginname' ); | |
function enqueue_scripts__pluginname() { | |
$jquery_location = WP_PLUGIN_URL . "/panomanager/js/jquery.js"; | |
wp_register_script('jquery', $jquery_location, true); |
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
jasmine.Matchers.prototype.toReturnAPromise = function() { | |
if ( 'function' !== typeof this.actual.then ) { | |
throw 'Did not return a promise'; | |
} | |
}; |
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 coffee = require('gulp-coffee'), | |
karma = require('karma').server; | |
gulp.task('compile-tests-coffee', functoin() { | |
return gulp.src('./test/unit/**/*.coffee') | |
.pipe(coffee({bare: true})) | |
.pipe(gulp.dest('test/unit')); | |
}); | |
gulp.task('unit-test', ['compile-tests-coffee'], function () { |
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
{ | |
"arrow_spacing": { | |
"level": "ignore" | |
}, | |
"camel_case_classes": { | |
"level": "error" | |
}, | |
"coffeescript_error": { | |
"level": "error" | |
}, |
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: Different theme for guest than logged in user | |
*/ | |
// You can also put this file in mu-plugins dir. | |
add_filter( 'template', 'switch_theme__db' ); | |
add_filter( 'stylesheet', 'switch_theme__db' ); |
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 | |
define( 'PRODUCT_QUERY_VAR', 'product__dbernar1' ); | |
define( 'PRODUCT_URL_PREFIX', 'products' ); | |
function get_permalink__dbernar1( $post = null ) { | |
if ( is_null( $post ) ) global $post; | |
return site_url( PRODUCT_URL_PREFIX . '/' . $post->post_name ); | |
} | |
add_action( 'init', 'create_post_type_rewrite_rules__dbernar1' ); |
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
assert = require 'assert' | |
Life = require '../src/life' | |
whenCurrentGenerationIs = Life.nextGenerationOf | |
any = it | |
nextGenerationContains = ( cell, nextGeneration ) -> assert cell in nextGeneration | |
nextGenerationDoesNotContain = ( cell, nextGeneration ) -> assert cell not in nextGeneration |
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 |
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
<?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" '; |
NewerOlder