Skip to content

Instantly share code, notes, and snippets.

View shiroyuki's full-sized avatar
🇨🇦
Working

Juti Noppornpitak shiroyuki

🇨🇦
Working
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<webconfig>
<mode>application</mode>
<basepath>
<static>static</static>
<template>template</template>
<session>memory</session>
</basepath>
<baseURI>/</baseURI>
<errorTemplate use="mako">myerror.html</errorTemplate>
import sys, os
basePath = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(basePath)
# Add the experimental package of Yotsuba 3
if not os.path.exists('/path/to/your/copy'):
raise Exception("Required Yotsuba 3 experimental package")
sys.path.append('/path/to/your/copy')
@shiroyuki
shiroyuki / module.config.php
Created January 17, 2012 18:09
module.config.php for ICX/ZF2/Blog
<?php
return array(
'routes' => array(
'blog-category' => array(
'type' => `Zend\Mvc\Router\Http\Literal`,
'options' => array(
'route' => '/category/index',
'defaults' => array(
'controller' => 'blog-category',
'action' => 'index',
@shiroyuki
shiroyuki / error.log
Created January 17, 2012 18:17
error.log on HTTP 500 after adding ICX/ZF2/Blog
[Tue Jan 17 13:04:36 2012] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'Zend\\Mvc\\Router\\Exception\\InvalidArgumentException' with message 'Missing "type" option' in /Users/jutin/Sites/z2/vendor/ZendFramework/library/Zend/Mvc/Router/SimpleRouteStack.php:235\nStack trace:
#0 /Users/jutin/Sites/z2/vendor/ZendFramework/library/Zend/Mvc/Router/Http/TreeRouteStack.php(112): Zend\\Mvc\\Router\\SimpleRouteStack->routeFromArray(Array)
#1 /Users/jutin/Sites/z2/vendor/ZendFramework/library/Zend/Mvc/Router/Http/TreeRouteStack.php(91): Zend\\Mvc\\Router\\Http\\TreeRouteStack->routeFromArray(Object(Zend\\Config\\Config))
#2 /Users/jutin/Sites/z2/vendor/ZendFramework/library/Zend/Mvc/Router/SimpleRouteStack.php(152): Zend\\Mvc\\Router\\Http\\TreeRouteStack->addRoute('blog-category', Object(Zend\\Config\\Config))
#3 /Users/jutin/Sites/z2/vendor/ZendFramework/library/Zend/Mvc/Bootstrap.php(114): Zend\\Mvc\\Router\\SimpleRouteStack->addRoutes(Object(Zend\\Config\\Config))
#4 /Users/jutin/Sites/z2/vendor/
@shiroyuki
shiroyuki / application.config.php
Created January 17, 2012 18:26
application.config.php for ICX/ZF2
<?php
return array(
'modules' => array(
'Application',
'Blog'
),
'module_listener_options' => array(
'config_cache_enabled' => false,
'cache_dir' => 'data/cache',
'module_paths' => array(
class SingletonInitializationException(Exception):
'''
This exception is used when the target class contain a special
attribute `_singleton_instance` not a reference to its own class.
'''
def singleton(class_reference, *args, **kwargs):
'''
Decorator to make a class to be a singleton class.
@shiroyuki
shiroyuki / duplicated_app_search.py
Created March 27, 2012 06:51
Duplicated App Finding Script for Launchpad on Mac OS X 10.7
'''
Find and provide command to remove a duplicate app icon on Launchpad for Mac OS X 10.7.
:Author: Juti Noppornpitak <[email protected]>
:Copyright: Juti Noppornpitak <[email protected]>
Prerequisites
-------------
pip install sqlalchemy
pip install https://github.com/shiroyuki/Tori/zipball/master
@shiroyuki
shiroyuki / setup.sh
Last active October 3, 2015 15:48
Set up script
export BASE_PATH="/var/www"
mkdir -p $BASE_PATH/bin
curl -o $BASE_PATH/.bash_profile https://gist.github.com/shiroyuki/2819364/raw/28eb2d6f6ee39845fa054cab56f8b998993a1138/.bashrc
# Customize VIM
curl -o $BASE_PATH/.vimrc https://gist.github.com/shiroyuki/2819393/raw/c9ae2db1b9959f6c60312aa716a2de107a7b3840/.vimrc
@shiroyuki
shiroyuki / .bashrc
Last active October 5, 2015 14:18
Bash Profile
# Homebrew code
export PATH=~/bin:$PATH
#export PYTHONPATH=~/Projects/Tori:~/Projects/Imagination:~/Projects/Kotoba:$PYTHONPATH
# Common
export SVN_EDITOR=vim
HISTCONTROL=ignoredups:ignorespace
shopt -s histappend
HISTSIZE=1000
HISTFILESIZE=2000
@shiroyuki
shiroyuki / .vimrc
Created May 28, 2012 14:14
VIM Configuration
syntax on
set number
set autoindent
set expandtab
set shiftwidth=4
set softtabstop=4