Skip to content

Instantly share code, notes, and snippets.

wada wadadanet

Block or report user

Report or block wadadanet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wadadanet
wadadanet / hamburger.pug
Last active Oct 11, 2019
より正確なハンバーガーメニューアイコン
View hamburger.pug
.hamburger: span
View docker-compose.yml
version: '3.3'
# PORT: 8211 <- この数字を変える
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
View 404.php
<main id="MainContents">
<div class="row">
<div class="col-md-12">
<div class="error-template">
<h1>
Oops!</h1>
<h2>
404 Not Found</h2>
<div class="error-details">
View template-functions.php
function console( $data, $log = false ) {
if(WP_DEBUG){
$_data = json_encode($data);
$obj = debug_backtrace();
$parent = $obj[0];
$path = $parent['file'];
$filename = basename($path);
if($log){
error_log("\n".gettype($data)."--", 3, dirname( __FILE__ ) . '/../../app.log');
error_log("\n".$_data, 3, dirname( __FILE__ ) . '/../../app.log');
@wadadanet
wadadanet / script.js
Last active Aug 30, 2019
HTMLが読み込まれてからJSを実行したい場合
View script.js
if (document.readyState === "loading"){
document.addEventListener("DOMContentLoaded", init);
} else {
init();
}
@wadadanet
wadadanet / wodpress_json_ld_page.php
Last active Aug 8, 2019
wordpress JSON-LD example
View wodpress_json_ld_page.php
<?php
$type = "WebPage"; // BlogPosting, WebSite, Article, Person, SearchAction, NewsArticle
$author_name = get_the_author_meta('display_name');
$logo_url = "https://www.coffee-break-designs.com/wp-content/themes/coffee-break-designs-v8/img/logo.svg";
$description = get_post_meta(get_the_id(), "_aioseop_description", true);
$thumbnail_id = get_post_thumbnail_id();
$imageobject = wp_get_attachment_image_src( $thumbnail_id, 'full' );
?>
<script type="application/ld+json">
{
@wadadanet
wadadanet / function.php
Last active Sep 27, 2019
wordpress shortcode "not break"
View function.php
function shortcode_not_break($atts, $content = null){
return do_shortcode(preg_replace('/(]<br>|]<br \/>)/', ']', $content));
}
add_shortcode('not_break', 'shortcode_not_break');
View mp4_gif.bat
@echo off
cd /d "%~dp0"
if "%~1" == "" goto error
mkdir "%~dp1gif\"
:loop
if not "%~nx1"=="" (
echo ---- %~nx1 ffmpeg...
@wadadanet
wadadanet / mozcjpeg
Created Jul 8, 2019
macのAutomatorで一括mozcjpeg処理をするシェルスクリプト
View mozcjpeg
#!/bin/sh
for f in "$@"
do
mkdir -p "$(dirname $f)/mozcjpeg"
/usr/local/bin/mozcjpeg $f &gt; "$(dirname $f)/mozcjpeg/$(basename $f)"
dir="$(dirname $f)/mozcjpeg"
done
osascript -e "display notification \"$dir\" with title \"mozcjpeg complete!\""
@wadadanet
wadadanet / 00-sass-color-setting.scss
Last active May 23, 2019
css変数も出力できるsass設定
View 00-sass-color-setting.scss
$theme-colors: (
primary: #ffffff,
secondary: #cccccc,
success: #28a745,
info: #aaaaaa,
warning: #ffc107,
danger: #dc3545,
light: #f8f9fa,
dark: #343a40
);
You can’t perform that action at this time.