Skip to content

Instantly share code, notes, and snippets.

View katapad's full-sized avatar

Yoshio Kakehashi katapad

View GitHub Profile
@WIDTH: 400px;
@Y: 100px;
div#container {
width: @WIDTH;
margin: auto;
position: relative;
.persepective(350px);
.origin(@WIDTH * 0.5, @Y);
.preserve3d();
@katapad
katapad / LetterTracking.coffee
Last active December 16, 2015 17:50
ひらがなとカタカナのトラッキングクラス
class LetterTracking
constructor: ($target) ->
$target.each((i, elem)=>
$elem = $(elem)
aTag = $elem.find('a');
if (@hasATag(aTag))
$elem = aTag
text = $elem.text()
spanText = @wrapSpan(text)
@katapad
katapad / Gruntfile.coffee
Created May 10, 2013 04:42
Gruntで更新のあったファイルだけFTPする
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-ftp-deploy'
ftpSettings =
auth:
host: "hogehoge.com"
port: 21
authKey: "hogehogekey"
src: "www"
@katapad
katapad / Gruntfiles.coffee
Last active December 17, 2015 05:48
bowerからいい感じにコピーとか結合をして、必要なファイルだけ持ってくる
grunt.initConfig
concat:
lib:
files:
'www/common/js/lib.js' : [
'src/js/vendors/jquery/jquery.min.js'
'src/js/vendors/modernizr/modernizr.js'
]
'www/common/js/vendors/easeljs-0.6.0.min.js' : [
'src/js/vendors/EaselJS-release_v0.6.0/lib/easeljs-0.6.0.min.js'
@katapad
katapad / Gruntfile.coffee
Last active December 17, 2015 10:49
grunt-contrib-jade でいい感じにオプションを渡してあげるやつ
_ = require 'lodash'
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-contrib-jade'
require('./src/config/jade.config.coffee')(_)
jadeOptions = require './src/config/base.config.coffee'
grunt.initConfig
@katapad
katapad / Gruntfile.coffee
Created May 17, 2013 18:08
grunt-contrib-jadeでmarkdown→htmlにしたものを読み込ませる
grunt.initConfig
md2html:
build:
files: [
expand: true,
cwd: 'src/jade',
src: ['**/*.md'],
dest: 'src/jade',
ext: '.html'
]
@katapad
katapad / AIR 3.6 for iOS and Android
Last active December 17, 2015 18:18
IDEAで設定してるcompiler options
Project Defaults
-default-size 640 1096 -swf-version=19 -default-frame-rate 60 -default-background-color 0xFFFFFF
Additional
-define+=CONFIG::mobile,false -define+=CONFIG::ios,false -define+=CONFIG::android,false -define+=CONFIG::desktop,true -define+=CONFIG::debug,true -define+=CONFIG::release,false -define+=CONFIG::device,false -compiler.optimize=false -compiler.incremental=true
@katapad
katapad / youtube.as
Created May 29, 2013 05:34
youtube player
private function getType(type:*):String
{
var result:String = '';
switch (type)
{
case -1: result = YoutubeEvent.UNSTARTED; break;
case 0: result = YoutubeEvent.ENDED; break;
case 1: result = YoutubeEvent.PLAYING; break;
case 2: result = YoutubeEvent.PAUSED; break;
case 3: result = YoutubeEvent.BUFFERING; break;
@katapad
katapad / .htaccess
Created May 31, 2013 10:22
imgとかはCDNにしつつ、.htmlだけ見えなくするhtaccess
<Files .htaccess>
order allow,deny
deny from all
</Files>
<Files ~ "\.(html)$">
AuthType Basic
AuthName "enter id and pass"
AuthUserFile /srv/hogehoge/public/.htpasswd
require valid-user
@katapad
katapad / .htaccess
Created May 31, 2013 10:24
index.htmlを /test2/sub/index.htmlのもので表示する mod_rewrite
RewriteEngine On
RewriteRule ^(/|index.html)$ /test2/sub2/index.html [P,L]