Skip to content

Instantly share code, notes, and snippets.

View hissy's full-sized avatar
💭
😄

Takuro Hishikawa hissy

💭
😄
View GitHub Profile
@hissy
hissy / gist:1272614
Created October 8, 2011 17:49
SuperCollider Stacked Chord Loop
(
// SynthDef
SynthDef("up-piano-20", {
arg freq=440, gate=1, amp=1, pan=0, downRate=20000, mix=0.25, room=0.15, damp=0.5;
var x, y, env;
env = Env.asr(5,1,5, -3);
x = SinOsc.ar(freq,0,amp);
y = LFNoise2.ar(0.2,downRate/100,downRate);
x = Latch.ar(x, Impulse.ar(y));
x = FreeVerb.ar(x,mix,room,damp);
@hissy
hissy / gist:1391436
Created November 24, 2011 14:14
concrete5: Add Header Item
<?php
$html = Loader::helper('html');
$this->addHeaderItem($html->javascript($this->getThemePath().'/original.js'));
?>
@hissy
hissy / gist:1510653
Created December 22, 2011 15:17
concrete5japan: what we changed in the former japanese edition
t抜け、言語ファイル、sample_content.sql以外
デフォルトの言語を日本語に設定。
https://github.com/concrete54japan/concrete5/commit/5bdda2cda2fb13bd5b79dde5c0de4183208cff87
日本語URL対応とインストール画面の日本語化
https://github.com/concrete54japan/concrete5/commit/41bd7a19adc434c3dff0354f0c000d614c2f1a93
日本語URL対応漏れ
https://github.com/concrete54japan/concrete5/commit/862ece76b0d08b030bdde3bec725f61997e49157
@hissy
hissy / c5-open-graph-tags.php
Created January 19, 2012 00:32
Open Graph Tags Setting for concrete5 site
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!-- Open Graph Tags Start -->
<?php
$page = Page::getCurrentPage();
$pageTitle = $page->getCollectionName();
$pageMetaTitle = $page->getCollectionAttributeValue('meta_title');
if ( $pageMetaTitle ) $pageTitle = $pageMetaTitle;
$pageOgTitle = $page->getCollectionAttributeValue('og_title');
if ( $pageOgTitle ) $pageTitle = $pageOgTitle;
$pageOgType = $page->getCollectionAttributeValue('og_type');
@hissy
hissy / wp-query-ref.php
Last active May 1, 2023 01:53 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
* Japanese translated by hissy
*
* CODEX: http://wpdocs.sourceforge.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/WP_Query#.E3.83.91.E3.83.A9.E3.83.A1.E3.83.BC.E3.82.BF
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
* Original: https://gist.github.com/luetkemj/2023628/9e911982440141a13cb1dd8ba1ad6b35cd7bbdd7
*/
@hissy
hissy / functions.php
Created March 24, 2012 09:04
Use jQuery Masonry in WordPress Theme
<?php
/**
* Enqueue scripts and styles
*/
function load_scripts() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' );
$dir = get_stylesheet_directory_uri();
wp_enqueue_script( 'jquery-masonry', $dir.'/js/jquery.masonry.min.js', array('jquery'), false, true );
@hissy
hissy / map.js
Created March 26, 2012 04:00
Show Multiple Markers on Google Map from JSON
jQuery(document).ready(function(){
jQuery("#map").each(function(){
SpotSearchMap = new SpotSearchMapObj(36.5626,136.362305, 8);
});
});
var Marker;
var SpotSearchMap;
var SpotSearchMapObj = Class.create();
SpotSearchMapObj.prototype = {
@hissy
hissy / Phoenix_BankPayment.csv
Created April 3, 2012 02:54
Japanese Translation for Magento BankPayment Extension
Bank Prepayment 銀行振込
Pay within X days X日以内に支払い
Please transfer the money within %s days to the following bank account 下記の銀行口座に%s日以内にお振込みください
Please transfer the money to the following bank account 下記の銀行口座にお振込みください
Please transfer the money within %s days to one of the following bank accounts 下記の銀行口座のいずれかに%s日以内にお振込みください
Please transfer the money to one of the following bank accounts 下記の銀行口座のいずれかにお振込みください
Account holder 口座名義
Account number 口座番号
Account number1 口座番号
Sort code Sort code
@hissy
hissy / gist:2317154
Created April 6, 2012 05:13
第10回 WordBench神戸のネタ
@hissy
hissy / gist:2886355
Last active October 5, 2015 22:18
#WordPress Get Toplevel Ancestor Page
<?php
/**
* Returns top level ancestor page
*
* Usage: $toplevel = get_toplevel_ancestor_page(get_the_ID());
*
* @param int|object $post Post ID or post object. Optional, default is the current post from the loop.
* @return WP_Post|null WP_Post on success or null on failure
*/
function get_toplevel_ancestor_page( $post ) {