Skip to content

Instantly share code, notes, and snippets.

tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-versions"
tap "homebrew/core"
tap "homebrew/services"
brew "unbound", restart_service: true
brew "ffmpeg"
brew "gifsicle"
brew "gist"
brew "httpd", restart_service: true
@ejointjp
ejointjp / full-bleed-image-with-css-grid.markdown
Last active January 5, 2021 23:13
Full bleed image with CSS Grid
@ejointjp
ejointjp / class-customize-multiple-checkbox-control.php
Last active August 18, 2020 07:32
WordPress テーマカスタマイザー 複数選択できるチェックボックスを作成する
<?php
// 複数選択できるチェックボックスを定義
class My_Customize_Multiple_Checkbox_Control extends WP_Customize_Control {
public $type = 'multiple-checkbox';
protected function render_content() {
if ( empty( $this->choices ) ) return; ?>
<?php if ( !empty( $this->label ) ) : ?>
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "homebrew/services"
brew "ffmpeg"
brew "gifsicle"
brew "gist"
brew "hardlink-osx"
brew "imagemagick"
brew "mas"
{"lastUpload":"2020-03-30T02:55:37.648Z","extensionVersion":"v3.4.3"}
@ejointjp
ejointjp / amazon-associate-link-builder-template.php
Last active January 5, 2020 23:48
Amazon Associate Link Builder Template
@ejointjp
ejointjp / functions-child.php
Last active October 29, 2019 05:36
WordPress parent and child Theme sample (Child can override the parent methods.)
<?php
// Child theme sample.
add_action('after_setup_theme', 'themename_child_theme_setup');
function themename_child_theme_setup() {
class Themename extends Themename_Base_Functions {
public function __construct() {
parent::__construct();
}
@ejointjp
ejointjp / theme-customizer.php
Last active July 10, 2020 07:05
コピペで使えるWordPress テーマカスタマイザーAPI サンプル
<?php
add_action('customize_register', 'themename_customize_register');
function themename_customize_register ($wp_customize) {
$wp_customize->add_panel(
'themename_panel', // パネルID
array(
'title' => 'パネルタイトル',
'priority' => 1000,
@ejointjp
ejointjp / class-admin-menu.php
Last active December 3, 2022 07:34
WordPress 管理画面のテンプレート
<?php
class My_Admin_Menu {
private $options;
private $option_name = 'my-menu';
public function __construct() {
// メニューを追加する
add_action('admin_menu', array($this, 'add_menu'));
// メニューを初期化する
add_action('admin_init', array($this, 'init'));
@ejointjp
ejointjp / index.js
Last active June 19, 2019 07:24
JavaScriptでGetパラメータを取得する
getParam (name, url) {
if (!url) url = window.location.href
name = name.replace(/[[\]]/g, '\\$&')
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)')
var results = regex.exec(url)
if (!results) return null
if (!results[2]) return
return decodeURIComponent(results[2].replace(/\+/g, ' '))
}