Skip to content

Instantly share code, notes, and snippets.

@kickbase
kickbase / private.xml
Last active February 11, 2019 16:39
Karabiner private.xml for Emacs, Vim, VSCode, Unity, Houdini.
<?xml version="1.0"?>
<root>
<appdef>
<appname>TERMINAL</appname>
<equal>com.apple.Terminal</equal>
</appdef>
<appdef>
<appname>ITERM2</appname>
<equal>com.googlecode.iterm2</equal>
</appdef>
@kickbase
kickbase / _gvimrc
Created August 5, 2018 03:55
[ Vim ] Kaoriya Vim Setting
"-------Preferences--------"
set ttyfast
set t_Co=256
set hidden
set autoread
set history=2000
set noswapfile
set backspace=start,eol,indent
set ambiwidth=double
set shortmess+=I
@kickbase
kickbase / check_no_IO_nodes.py
Last active November 22, 2018 14:03
[Houdini] [Python] Look for nodes without inputs / outputs, and set red color.
sn = hou.selectedNodes()
for n in sn:
if (len(n.inputs()) is 0) and (len(n.outputs()) is 0):
n.setColor(hou.Color([1,0,0]))
# n.setComment("NO I/O connected.")
# n.setGenericFlag(hou.nodeFlag.DisplayComment,True)
n.setSelected(0)
@kickbase
kickbase / .zshrc
Created December 3, 2018 11:43
[ zsh ] my .zshrc settings
# Homebrewのパッケージ
export PATH=/usr/local/bin:$PATH
# SSHで接続した先で日本語が使えるようにする
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# ページャ
export PAGER=/usr/local/bin/vimpager
export MANPAGER=/usr/local/bin/vimpager
@kickbase
kickbase / VEXpressions.txt
Last active April 7, 2024 02:34
[Houdini] user setting file, save under the HOUDINI_USER_PREF_DIR.
attribwrangle/snippet
[kb] Create range (Run Over:Point)
float range = @ptnum/(@numpt - 1.0);
attribwrangle/snippet
[kb] Create range (Run Over:Primitives)
float range = @primnum/(@numprim - 1.0);
attribwrangle/snippet
[kb] Array example
@kickbase
kickbase / watermark.sh
Last active October 5, 2019 04:55
[ shellscript ] Composit a watermark to a videos.
#!/bin/sh
# usage
# 1 chmod 755 watermark.sh
# 2 ./watermark.sh
for FILE in *.mp4
do
FILENAME=`echo ${FILE} | sed 's/\.[^\.]*$//'`
ffmpeg -i ${FILENAME}.mp4 -loop 1 -i watermark.png -filter_complex "[1]loop=-1,setpts=N/25/TB[w];[0][w]overlay=shortest=1:x=if(eq(mod(n\,300)\,0)\,sin(random(1))*w\,x):y=if(eq(mod(n\,300)\,0)\,sin(random(1))*h\,y)" sample_${FILENAME}.mp4
done
@kickbase
kickbase / check_duration.sh
Created November 11, 2019 03:17
[ shellscript ] Check videos duration.
#!/bin/sh
# usage
# 1 chmod 755 check_duration.sh
# 2 ./check_duration.sh
for FILE in *.mp4
do
FILENAME=`echo ${FILE} | sed 's/\.[^\.]*$//'`
ffprobe -i ${FILENAME}.mp4 -show_entries format=filename,duration -sexagesimal -v quiet -of csv="p=0"
done
@kickbase
kickbase / create_attribute_wrangle.py
Created February 18, 2020 18:31
[Houdini] [Python] Create Attribute Wrangle Node with single wire conected.
for node in hou.selectedNodes():
attribWrangle = node.parent().createNode("attribwrangle")
attribWrangle.setInput(0, node)
attribWrangle.setPosition(node.position() + hou.Vector2(0, -1))
@kickbase
kickbase / create_attribute_wrangle_multi.py
Last active April 1, 2025 09:51
[Houdini] [Python] Create Attribute Wrangle Node with multi wire conected.
selNodes = hou.selectedNodes()
INPUT_LIMIT = 4
sop = hou.sopNodeTypeCategory()
if selNodes and all([n.parent().childTypeCategory() == sop for n in selNodes]):
attribWrangle = selNodes[0].parent().createNode("attribwrangle")
pos = []
for i, node in enumerate(selNodes):
if i < INPUT_LIMIT:
@kickbase
kickbase / create_attribute_wrangle_with_soptoolutils.py
Created February 19, 2020 01:04
[Houdini] [Python] Create Attribute Wrangle Node with soptoolutils.
import soptoolutils
soptoolutils.genericTool(kwargs, 'attribwrangle')