Skip to content

Instantly share code, notes, and snippets.

@yuuan
yuuan / services-portion.php
Created February 13, 2014 09:53
Phalcon の project/app/config/services.php を編集して Volt に date フィルターを追加してみた。
<?php
// ...
/**
* Setting up the view component
*/
$di->set('view', function () use ($config) {
$view = new View();
@yuuan
yuuan / centos.conf
Created April 3, 2014 02:04
Config file for CentOS 6.5 on coLinux.
#
# This is an example for a configuration file that can
# be passed to colinux-daemon in this manner:
#
# colinux-daemon @example.conf
#
# Note that you can still prepend or append configuration and
# boot parameters before and after '@', or you can use more
# that one '@ to load several settings one after another.
#
#This configuration has been tested on GitLab 6.0.0 and GitLab 6.0.1
#Note this config assumes unicorn is listening on default port 8080.
#Module dependencies
# mod_rewrite
# mod_ssl
# mod_proxy
# mod_proxy_http
# mod_headers
# This section is only needed if you want to redirect http traffic to https.
@yuuan
yuuan / AppModel.php
Created August 21, 2014 08:43
CakePHPで `created` の代わりに `created_at` を使うようにするために AppModel を強引にいじってみた。
<?php
/**
* Application model for Cake.
*
* This file is application-wide model file. You can put all
* application-wide model-related methods here.
*
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Model
* @since CakePHP(tm) v 0.2.9
@yuuan
yuuan / color-scheme-for-view-source.css
Last active August 29, 2015 14:15
Firefox で `ページのソースを表示` したときのデザインを上書きするためのスタイルシート
@-moz-document url-prefix(view-source) {
body {
margin: 0;
}
#viewsource {
font-family: "Ricty";
font-size: 10pt;
line-height: 135%;
}
#line1:before {
<?php
/**
* `@param` で渡された変数が宣言されていないときに、
* `debug` モードならエラーを出し、そうでなければ宣言して null を代入する
*
*/
Blade::extend(function($view, $compiler)
{
$pattern = $compiler->createMatcher('param');
@yuuan
yuuan / git-rprompt.zsh
Last active October 8, 2015 03:58 — forked from uasi/gist:214109
zsh/pcre version.
#
# Show branch name in Zsh's right prompt
#
autoload -Uz VCS_INFO_get_data_git; VCS_INFO_get_data_git 2> /dev/null
setopt prompt_subst
setopt re_match_pcre
function rprompt-git-current-branch {
@yuuan
yuuan / Wikipedia.citePopup.user.js
Created November 9, 2012 16:40
Add pop-up on reference to footnote
// ==UserScript==
// -*- mode:JScript; Encoding:utf8n -*-
// @name Wikipedia.citePopup
// @namespace http://d.hatena.ne.jp/p-arai/
// @description Add pop-up on reference to footnote
// @include http://ja.wikipedia.org/wiki/*
// @grant none
//
// @author p-arai, yuuAn
// @version 2012.11.10
// ==UserScript==
// @name Translate DateTime in GitLab
// @namespace http://www.yuuan.net/item/1054
// @description 英語で書かれた日付を数字に変える
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @include http://gitlab.com/*
// @version 0.1
// @grant none
// ==/UserScript==
(function($) {
@yuuan
yuuan / configure-vim.sh
Created November 4, 2015 07:24
Configure vim on Fedora
#!/bin/sh
./configure --enable-multibyte --with-features=huge --disable-selinux \
--prefix=/usr/local \
--enable-luainterp=yes --with-luajit \
--enable-perlinterp=dynamic \
--enable-rubyinterp=dynamic \
--enable-pythoninterp=dynamic --enable-python3interp=dynamic \
--enable-fail-if-missing