Skip to content

Instantly share code, notes, and snippets.

View torounit's full-sized avatar

Hiroshi Urabe torounit

View GitHub Profile
@gatespace
gatespace / gist:7147747
Last active January 22, 2016 19:33
[WordPress] デフォルトのアーカイブウィジェットを特定のカスタム投稿タイプの時のみその投稿タイプのアーカイブにする。要「Custom Post Type Permalinks」プラグイン。
/**
* ウィジェット「アーカイブ」にフィルター
* require Custom Post Type Permalinks
*/
add_filter( 'widget_archives_args', 'my_widget_archives_args', 10, 1);
add_filter( 'widget_archives_dropdown_args', 'my_widget_archives_args', 10, 1);
function my_widget_archives_args( $args ){
if ( ! is_admin() ) {
if ( 'blog' == get_post_type() ) {
@hissy
hissy / rscsvimporter-debug.php
Last active April 6, 2020 03:24
Really Simple CSV Importer Debugger add-on
<?php
/*
Plugin Name: Really Simple CSV Importer Debugger add-on
Description: Enables to dry-run-testing with Really Simple CSV Importer. When this add-on plugin activated, csv data will not imported, just displayed on dashboard.
Author: Takuro Hishikawa
Version: 0.2
*/
class rscsvimporter_debug {
// singleton instance
@koba04
koba04 / api.md
Last active November 2, 2024 00:52
Vue.js note(v0.10.3). not translate. This is draft of https://github.com/koba04/vuejs-book .

API

Class: Vue

  • Vueはvue.jsのコアとなるコンストラクタ
  • インスタンスが作られたときにデータバインディングが開始される
  • オプションを取ることも出来て、DOMやデータやメソッドについて定義出来る
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@miya0001
miya0001 / gist:fdc361b5de4e56ad8109
Last active August 29, 2015 14:11
wp-tests-install
#!/usr/bin/env bash
set -ex;
echo 'DROP DATABASE IF EXISTS wordpress_test;' | mysql -u root
rm -fr /tmp/wordpress
rm -fr /tmp/wordpress-tests-lib
bash $(wp --info --format=json | jq -r '.wp_cli_dir_path')/templates/install-wp-tests.sh wordpress_test root '' localhost latest;
@hissy
hissy / gist:0b8df0149fbba16be08d
Last active March 21, 2023 02:15
[Really Simple CSV Importer] 画像をインターネットからダウンロードして投稿に添付し、画像のIDをカスタムフィールドに登録
<?php
/*
Plugin Name: Really Simple CSV Importer Action add-on
Description: Run the additional action after importing the post data
Author: Takuro Hishikawa
Version: 0.1
*/
class rscsvimporter_action {
// singleton instance
@tmknom
tmknom / fabfile.py
Last active September 27, 2020 00:28
CentOSをセキュアにセットアップするFabricスクリプト(暫定版:http://nekopunch.hatenablog.com/entry/2015/01/16/112402
# -*- encoding:utf-8 -*-
#
# CentOSをセキュアにセットアップするFabricスクリプト
#
# 前提条件 : Fabricインストール済/SSHの公開鍵作成済
# 実行方法 : fab deploy
# 検証環境 : CentOS6.6 (さくらのVPS 標準OSインストール)
#####################################################################
from fabric.api import env, run, sudo, put
@ginrou
ginrou / construct_lenna.py
Last active May 25, 2025 07:57
DCTでlennaを再構成する
#!/bin/env python
import numpy as np
import scipy.misc
from scipy.fftpack import dct, idct
import sys
H = 128
W = 128
lenna = scipy.misc.imresize(scipy.misc.lena(), (H, W)).astype(float)
module A2 where
------------------------------------------------------
-- 述語論理
-- まずは命題論理から
-- 真(⊤),偽(⊥)の定義が必要
-- ⊥ は証明がひとつもないような命題だから, 空集合によって表す
-- 帰納的定義によって次のように表現することができる
@JodiWarren
JodiWarren / acfpro-composer.json
Last active March 31, 2020 16:42
Advanced Custom Fields PRO for Composer
{
"repositories": [
{
"type": "package",
"package": {
"name": "advanced-custom-fields/advanced-custom-fields-pro",
"version": "5.0",
"type": "wordpress-plugin",
"dist": {
"type": "zip",