Skip to content

Instantly share code, notes, and snippets.

View hissy's full-sized avatar
💭
😄

Takuro Hishikawa hissy

💭
😄
View GitHub Profile
@certainlyakey
certainlyakey / rscsvimporter_replace_save_post.php
Last active August 29, 2015 14:05
Wordpress - import post connections from CSV file (with RS CSV Importer and Posts 2 Posts plugins)
<?php
/*
Plugin Name: Replace save_post method of Really Simple CSV Importer (customized)
Description: This is an example add-on.
Author: Takuro Hishikawa,
Version: 0.2
*/
class rscsvimporter_replace_save_post {
// singleton instance
@justinkelly
justinkelly / javascript_mobile_OS_detector.js
Created October 12, 2010 03:09
Javascript mobile OS detector
/*
* Simple javascript mobile OS / iphone/ android detector
*
* License: GPLv3+
* Author: justin.kelly.org.au
*
*/
$(document).ready(function() {
var deviceIphone = "iphone";
@fnichol
fnichol / README.md
Created January 3, 2011 16:20
Sample chef-solo config for vagrant prototyping
@nulltask
nulltask / .gitignore
Created March 3, 2012 20:43
OSC over HTTP example
node_modules
.DS_Store
._*
@miya0001
miya0001 / gist:3065723
Created July 7, 2012 10:06
facebookのlike boxを横幅100%で指定してレスポンシブデザインに対応。
.fbcomments,
.fb_iframe_widget,
.fb_iframe_widget[style],
.fb_iframe_widget iframe[style],
.fbcomments iframe[style],
.fb_iframe_widget span{
width: 100%! important;
}
@ounziw
ounziw / gist:3730738
Created September 16, 2012 01:57
debugging translation for concrete5.6
<?php
defined('C5_EXECUTE') or die("Access Denied.");
// Put this file into concrete/startup/localization.php
function remove_percent_from_text($text) {
$removed = array('$','%');
$no_var_text = str_replace($removed,'_',$text);
$no_var_text .= ' '; // Space for Readability
return $no_var_text;
}
@wokamoto
wokamoto / gsearch_test.php
Last active December 14, 2015 23:38
[WordPress][PHP] Google Search API で関連記事を取得するサンプル
<?php
include('/path/to/wordpress/wp-load.php');
$post_id_org = 2895; // post ID
// get keywords
$keywords = array();
$tags_categories = get_the_terms($post_id_org, array('post_tag','category'));
foreach ($tags_categories as $val) {
if ( in_array($val->name, $keywords) )
@wokamoto
wokamoto / update-website.sh
Created April 9, 2013 01:24
特定のディレクトリに移動して git pull するためのシェルスクリプト
#!/bin/sh
if [ $# -ne 0 ]; then
DIRNAME=$1
else
while :
do
echo -n "please input virtual host dir: "
read DIRNAME
if [ "$DIRNAME" != ""]; then
break;
@shin1x1
shin1x1 / Vagrantfile
Last active December 18, 2015 00:39
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "centos64_64"
config.vm.define :web do |web|
web.vm.host_name = "vg.local"
web.vm.network :hostonly, "192.168.33.12"
web.vm.customize ["modifyvm", :id, "--memory", 1024]
@wokamoto
wokamoto / shortcode_recent_posts.php
Last active December 19, 2015 12:19
[WordPress] shortcode recent_posts
<?php
add_shortcode('recent_posts', 'my_recent_posts');
function my_recent_posts($atts) {
// デフォルトテンプレート
$template = '<div style="border-bottom:dotted 1px #aaaaaa;margin-bottom:20px;font-size:14px">
<div class="title"><a href="%s" target="_top">%s</a></div>
<div class="day" style="font-size:12px;color:#999999">%s</div>
</div>
';