Skip to content

Instantly share code, notes, and snippets.

View baku89's full-sized avatar
🍡

Baku 麦 baku89

🍡
View GitHub Profile
@baku89
baku89 / gulpfile.coffee
Created July 5, 2015 11:18
my gulpfile.coffee [07.05.15]
module.exports = gulp
#----------------------------------------
gulp = require 'gulp'
coffee = require 'gulp-coffee'
compass = require 'gulp-compass'
jade = require 'gulp-jade'
plumber = require 'gulp-plumber'
srcmap = require 'gulp-sourcemaps'
@baku89
baku89 / resume-web-develpment
Last active November 14, 2017 18:45
Resuming web develpment environment from shell script (Sublime Text + Gulp)
# You have to exec below to make 'subl' command enabled.
# (https://www.sublimetext.com/docs/3/osx_command_line.html)
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
@baku89
baku89 / c4dpy-frame-by-frame-processing.py
Last active July 1, 2018 02:22
Processing frame by frame from Script Manager
# NOTE: this script stops when esc key pressed not to freeze c4d because of some heavy codes.
import c4d
from c4d import gui
def frame( f ):
# exec some processing..
pass
def escPressed():
@baku89
baku89 / bk_AnimateToCurrentPos.jsx
Created August 24, 2015 07:05
AEScript: Copy position keyframes to stop with each layer's position at the end
/*
* Usage:
* 1) Select destination layers and then select source layer
* 2) Run
*/
// https://github.com/douglascrockford/JSON-js/blob/master/json2.js
#include "json2.js"
main();
@baku89
baku89 / example.sh
Last active September 8, 2015 13:12
proce55ing with pipeline
./p5-pipe.sh pipe_invert pipe_blur --args ./sample.png
javascript:charas=["asuka","natsuki","kaori","hazuki","sapphire","haruka","yuuko","shuichi","reina"];$.each(charas,function(a,u){$("."+u).css("background-image","url(http://baku89.com/files/kumiko/kumiko_"+a+".jpg")});
@baku89
baku89 / mat2quat.py
Created November 1, 2015 14:48
Extract quaternion in right-hand rule from affine matrix in left-hand rules
# http://afni.nimh.nih.gov/pub/dist/src/pkundu/meica.libs/nibabel/eulerangles.py
import eulerangles
import c4d
threeMat = c4d.Matrix().Scale(c4d.Vector(1, 1, -1))
def mat2quat(mat):
mt = threeMat * m
v1, v2, v3 = mat.v1, mat.v2, mat.v3
rotMat = [
@baku89
baku89 / count_keyframes_c4d.py
Created December 5, 2015 04:33
Count keyframes of active document
from c4d import gui
import shutil
num = 0
def countObjectKeyframe(obj):
global num
tracks = obj.GetCTracks()
@baku89
baku89 / .zshrc
Last active March 21, 2016 15:21
cdw
cdw() {
cd ${WORKDIR}
if [ $# != 0 ]; then
cd ${WORKDIR}
projDir=$(ls | grep ${1})
if [ -d "$projDir" ]; then
cd ${projDir}
else
echo "\"${1}\" does not exists \n"
ls
@baku89
baku89 / .zshenv
Last active March 21, 2016 15:44
My work-related shell scripts & zsh configs
WORKROOT=${HOME}/Works
WORKDIR=${WORKROOT}/$(date +"%Y")