This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#encoding: utf-8 | |
#erbテンプレートをhtmlに変換する | |
require 'erb' | |
require 'fileutils' | |
task :default => [:erb2html,:scss2css] | |
def Page(partials,erb) | |
pageBase=Class.new do|klass| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ruby -rsinatra -e 'set :public_folder, "."' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
#line 1 "mySketch.ino" | |
*/ | |
#include <SPI.h> | |
/* | |
#include "Arduino.h" | |
void foo(TwoWire bar); | |
void setup(); | |
void loop(); | |
#line 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery ($)-> | |
$(".product .image").myScrollTrigger({offset:-300 | |
,init:-> | |
$this=$(this) | |
$this.css({marginLeft:"20px",opacity:0}) | |
,appear:-> | |
$this=$(this) | |
$this.transit({marginLeft:"0px",opacity:1},2000) | |
}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setupHitArea(mc){ | |
var b=mc.getBounds(); | |
mc.hitArea=new createjs.Shape(); | |
mc.hitArea.graphics=new createjs.Graphics().beginFill("#FFF").drawRect(b.x,b.y,b.width,b.height); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# $ ./一括ダウンロード.sh "http://example.com" | |
mkdir -p ~/Desktop/一括ダウンロード/ | |
cd ~/Desktop/一括ダウンロード/ | |
echo "==== begin download $1 ====" >> log.txt | |
/usr/local/bin/wget --recursive --no-parent --page-requisites --html-ex --trust-server-names $1 >> log.txt 2>&1 | |
echo "==== end download $1 ====" >> log.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ofRectangleにこのメソッド欲しいなー | |
inline ofRectangle ofRectangle_contain(const ofRectangle& _this,const ofRectangle& target){ | |
ofRectangle rect=target; | |
float thisAspectRatio=_this.getAspectRatio(); | |
float targetAspectRatio=target.getAspectRatio(); | |
if(thisAspectRatio<targetAspectRatio){ | |
//横が余る | |
rect.width=target.height*thisAspectRatio; | |
rect.x=(target.width-rect.width)*0.5f; | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#前提 | |
#brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-theora --with-libogg | |
function usage(){ | |
cat <<EOT | |
Usage: | |
$(basename ${0}) INPUT_MP4_FILE OUTPUT_OGV_FILE | |
EOT | |
exit 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "pathname" | |
def usage | |
puts "Usage:" | |
puts "\t#{$0} SRC_DIR DST_DIR" | |
exit false | |
end | |
def is_same?(a,b) | |
return [a,b].all?{|i|i.file? && i.exist?} && (a.read==b.read) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://abrakatabura.hatenablog.com/entry/2015/08/22/095842 | |
#を参考に、エラーが起きたのでパラメータを少し変更 | |
mkdir release_asm | |
cd release asm | |
emcmake cmake -DBUILD_CUDA_STUBS=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_JASPER=OFF -DBUILD_JPEG=OFF -DBUILD_OPENEXR=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_PNG=OFF -DBUILD_TBB=OFF -DBUILD_TESTS=OFF -DBUILD_TIFF=OFF -DBUILD_WITH_DEBUG_INFO=OFF -DBUILD_ZLIB=OFF -DBUILD_opencv_apps=OFF -DBUILD_opencv_ts=OFF -DBUILD_opencv_world=OFF -DWITH_1394=OFF -DWITH_CLP=OFF -DWITH_CUBLAS=OFF -DWITH_CUDA=OFF -DWITH_CUFFT=OFF -DWITH_FFMPEG=OFF -DWITH_GDAL=OFF -DWITH_GIGEAPI=OFF -DWITH_GSTREAMER=OFF -DWITH_GSTREAMER_0_10=OFF -DWITH_GTK=OFF -DWITH_GTK_2_X=OFF -DWITH_JASPER=OFF -DWITH_JPEG=OFF -DWITH_LIBV4L=OFF -DWITH_NVCUVID=OFF -DWITH_OPENCL=OFF -DWITH_OPENCLAMDBLAS=OFF -DWITH_OPENCLAMDFFT=OFF -DWITH_OPENEXR=OFF -DWITH_OPENGL=OFF -DWITH_OPENMP=OFF -DWITH_OPENNI=OFF -DWITH_OPENNI2=OFF -DWITH_PNG=OFF -DWITH_PVAPI=OFF -DWITH_QT=OFF -DWITH_TBB=OFF -DWITH_TIFF=OFF -DWITH_UNICAP=OFF -DWITH_V4L=OFF -DWITH_VTK=O |
OlderNewer