Skip to content

Instantly share code, notes, and snippets.

View torounit's full-sized avatar

Hiroshi Urabe torounit

View GitHub Profile
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="eastwood"
# Example aliases
@torounit
torounit / pageLink.coffee
Created May 27, 2014 11:07
ページ内リンクをスムーススクロールにするScript
@torounit
torounit / gulpfile.coffee
Last active August 29, 2015 14:03
Compassで新規ファイルも含めて監視し、all.scssをコンパイルする。
"use strict"
gulp = require "gulp"
watch = require 'gulp-watch'
compass = require "gulp-compass"
path = require 'path'
plumber = require 'gulp-plumber'
publicDir = "./public/"
@torounit
torounit / .gitignore
Created July 17, 2014 08:32
vccwを使ったときの.gitignore。
.vagrant
www/wordpress/*.*
www/wordpress/wp-admin/
www/wordpress/wp-includes/
www/wordpress/wp-content/*.*
www/wordpress/wp-content/*/
!www/wordpress/wp-content/plugins/
www/wordpress/wp-content/plugins/*/
@torounit
torounit / .bowerrc
Last active August 29, 2015 14:06
最近のフロントエンドの初期設定。一応WordPress案件用に作ったけど他でも使えます。macであればinit.shすればだいたいokです。
{
"directory": "vendor/assets/bower_components",
"json": "bower.json"
}
@torounit
torounit / retina-post-thumbnail.php
Created October 7, 2014 02:48
投稿サムネイルをretina対応する。
<?php
add_image_size("my-image-size", 300, 200, true);
add_image_size("my-image-size@2x", 600, 400, true);
add_filter("post_thumbnail_html",function( $html, $post_id, $post_thumbnail_id, $size, $attr ){
$retina_size = $size."@2x";
if(!has_image_size($retina_size)) {
return $html;
@torounit
torounit / PageContents.php
Last active August 29, 2015 14:10
WordPressの固定ページの中身をテーマ内のファイルと片方向で同期する。
<?php
Class PageContents {
private $dir;
private $separator = "_";
private $content_dir = "page-contents";
public function __construct() {
$this->dir = get_stylesheet_directory()."/".$this->content_dir;
}
@torounit
torounit / Vagrantfile
Created December 23, 2014 18:09
https://github.com/torounit/concrete5 でconcrete5.7系を立てる時のvagrantfile.
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
#
# Configuration
#
#VM_BOX = "ubuntu/trusty64" # Ubuntu 14.04
<?php
$post_types = get_post_types( array('_builtin'=>false, 'publicly_queryable'=>true, 'show_ui' => true) );
foreach ($post_types as $key => $post_type) {
$posts = get_posts( array("post_type" => $post_type, "posts_per_page" => 1) );
foreach ( $posts as $post ) : setup_postdata( $post ); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php endforeach;
@torounit
torounit / grid.scss
Created February 3, 2015 08:02
Grid
$gutter: 20px !default;
$flex: true !default;
$colslist: 1, 2, 3, 4, 5, 6, 12;
@mixin grid-unit($num) {
@for $i from 1 through $num {
&_#{$i}of#{$num} {
width: percentage($i/$num);
flex-basis: percentage($i/$num);