Skip to content

Instantly share code, notes, and snippets.

View hissy's full-sized avatar
💭
😄

Takuro Hishikawa hissy

💭
😄
View GitHub Profile
@wokamoto
wokamoto / crazy_bone-admin_menu_capability.php
Last active December 21, 2015 01:28
[WordPress] [Crazy Bone] Don't show menu 'Login log' to non-administrator.
<?php
add_filter('crazy_bone::admin_menu_capability', 'crazy_bone_capability');
function crazy_bone_capability($capability){
return 'edit_users';
}
@pwenzel
pwenzel / 0. mamp_install_composer.bash
Last active March 30, 2021 16:47
Global composer install for MAMP Users on OSX
# Global composer install for MAMP Users on OSX
# http://getcomposer.org/doc/00-intro.md#globally
# For PHP 5.4 Use:
# alias php=/Applications/MAMP/bin/php/php5.4.4/bin/php;
alias php=/Applications/MAMP/bin/php/php5.3.6/bin/php;
curl -sS https://getcomposer.org/installer | php;
mv composer.phar /usr/local/bin/composer;
composer help;
@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>
';
@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]

すぐれた PHP ライブラリとリソース

Awesome PHP の記事をフォークして翻訳したものです (2013年4月25日)。おどろくほどすごい PHP ライブラリ、リソースやちょっとした情報のリストです。

【訳者コメント】 PHP 入門者のかたにはクィックリファレンスとして PHP: The Right Way 、セキュリティに関しては2011年3月に出版された 体系的に学ぶ 安全なWebアプリケーションの作り方 をおすすめします。

Composer

@awshout
awshout / foundation4-section-menu.php
Last active May 5, 2020 20:46
WordPress Menu & Walker for ZURB's Foundation 4 Sections
<?php
add_theme_support('menus');
/**
* http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'main-menu' => 'Main Menu',
));
@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;
@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) )
<?php
/**
* Plugin Name: Deny Giant Image Uploads
* Description: Prevents Uploads of images greater than 3.2MP
* Author: TJNowell
* Author URI: http://tomjn.com
* Plugin URI: http://tomjn.com/164/clients-who-upload-huge-camera-photos-decompression-bombs/
* Version: 1.1
*/
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: