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 | |
class SampleTest extends WP_UnitTestCase { | |
function test_sample() { | |
$args = array( | |
'public' => true, | |
'label' => 'Books' | |
); |
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_filter( 'nav_menu_css_class', function ( $classes, $item, $args ) { | |
if ( ! empty( $args->li_class ) ) { | |
$classes[] = $args->li_class; | |
} | |
return $classes; | |
}, 10, 3 ); |
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 | |
/** | |
* Created by PhpStorm. | |
* User: torounit | |
* Date: 15/03/06 | |
* Time: 11:03 | |
* | |
* Taxonomy Decorator. | |
*/ |
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
#!/usr/bin/env bash | |
set -e | |
echo '{ | |
"nginx" : { "http2_enable" : true, "config" : { "user" : "ec2-user" } }, | |
"php" : { "config" : { "user" : "ec2-user" } }, | |
"hhvm" : { "enabled" : true, "config" : { "user" : "ec2-user" } }, | |
"run_list" : [ "recipe[amimoto]" ] | |
}' > /opt/local/amimoto.json |
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 = $('<ul />'); | |
var request = $.getJSON('http://torounit.com/wp-json/wp/v2/posts?_jsonp=?') | |
request.done(function(data){ | |
data.forEach(function(row){ | |
var item = $('<li>'); | |
var content = $('<a />').text(row.title.rendered).attr('href', row.link); | |
item.append(content); | |
list.append(item); | |
}); |
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_filter( 'document_title_parts', function ( $title ) { | |
if ( is_front_page() ) { | |
unset( $title['title'] ); | |
$title['tagline'] = get_bloginfo( 'description', 'display' ); | |
} | |
return $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
(function($){ | |
$(function(){ | |
var $target = $('.target'); | |
$('.event-target').hover( | |
function(){ | |
$target.addClass('hoge'); | |
}, | |
function(){ | |
$target.removeClass('hoge'); |
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
#!/bin/sh | |
service monit stop | |
service nginx stop | |
docker run -it --rm -p 443:443 --name letsencrypt -v "/etc/letsencrypt:/etc/letsencrypt" -v "/var/lib/letsencrypt:/var/lib/letsencrypt" quay.io/letsencrypt/letsencrypt:latest certonly -d exmample.com -m [email protected] --agree-tos --standalone --renew-by-default | |
service nginx start | |
service monit start |
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
git checkout --orphan dist | |
git rm -rf . | |
touch .gitkeep | |
git add .gitkeep | |
git commit -a -m "dist branch init" | |
git push origin dist |