Skip to content

Instantly share code, notes, and snippets.

@ahomu
ahomu / coffeedoc.js
Created September 2, 2012 10:10
coffeedoc task
/**
coffeedoc: {
dist: {
target: 'src/coffee',
options: {
output: 'docs',
parser: 'requirejs',
renderer: 'html'
}
}
@ahomu
ahomu / doctest.coffee
Created September 2, 2012 10:09
.coffee documentation comment sample for YUIDoc
###*
# hogehoge test description
# @class Hoge
###
class Hoge
###*
# fuga is number
# @property {Number} fuga
###
@fuga
@ahomu
ahomu / coffeelint.js
Created September 1, 2012 05:15
coffeelint task
// tasks/coffeelint.js
module.exports = function(grunt) {
var lint = require('coffeelint');
/**
* Task
* task name is 'clint', but helper & global config name are 'coffeelint'
*/
grunt.registerMultiTask('clint', 'Lint your CoffeeScript!', function() {
@ahomu
ahomu / Gruntfile.js
Created August 31, 2012 20:58
更新したファイル+対応するテストケースのみ含むheadlessテスト用のSpecRunner.html作るくん
// 抜粋
module.exports = function(grunt) {
grunt.initConfig({
'build-runner': {
part: {
pairing: {
'dist/js' : 'test/spec'
},
options: {
@ahomu
ahomu / test.styl
Created August 29, 2012 07:23
-I でnibにパス通し
// stylus -I "$HOME/node_modules/nib/lib"
@import 'nib';
vendor-prefixes = webkit official
*
background linear-gradient(top, white, black)
box-sizing border-box
transition
@ahomu
ahomu / gist:3381712
Created August 17, 2012 19:13
options (grunt-stylus)
// https://github.com/sapegin/grunt-stylus
grunt.initConfig({
stylus: {
main: {
files: {
'dist/css/main.css' : 'src/stylus/main.styl'
},
watch: ['src/stylus/**/*.styl'],
options: {
@ahomu
ahomu / detectVendorFunction.js
Created July 22, 2012 03:30
ベンダープレフィックス決めるくん.js
function detectVendorFunction(object, methodName) {
var upperName = methodName.charAt(0).toUpperCase()+methodName.substr(1),
detectedMethod;
detectedMethod = object[methodName] ||
object['webkit'+upperName] ||
object['moz'+upperName] ||
object['ms'+upperName] ||
object['o'+upperName];
@ahomu
ahomu / gist:3052843
Created July 5, 2012 10:28
#ablogcms モジュールID変更画面に飛ぶボタンをつくるためのHookサンプル
<?php
// php/ACMS/User/Hook.php として作成
// config.server.phpのHOOK_ENABLEを1にしてください
class ACMS_User_Hook extends ACMS_Hook
{
/**
* @param string &$res
* @param ACMS_GET $thisModule
@ahomu
ahomu / gist:2916999
Created June 12, 2012 11:31
ミニマルViewModelもどきの素
# ViewModel Class
class VM
constructor:(vmElm)->
@elm = vmElm
propElms = vmElm.querySelectorAll('[data-prop]')
for propElm in propElms
key = propElm.getAttribute('data-prop');
if key
@[key] = new VMprop(propElm)
@ahomu
ahomu / ACMS_User_Hook.php
Created June 8, 2012 12:23
#ablogcms たぶんこうなるHook
<?php
class ACMS_User_Hook extends ACMS_Hook
{
/**
* GETモジュール処理前
* 解決前テンプレートの中間処理など
*
* @param string &$tpl
* @param ACMS_GET $thisModule