Skip to content

Instantly share code, notes, and snippets.

View splhack's full-sized avatar

Kazuki Sakamoto splhack

View GitHub Profile
an <silent> 9998.331 Window.Select\ Next\ Window <Nop>
an <silent> 9998.332 Window.Select\ Previous\ Window <Nop>
an 9998.333 Window.-SEP2- <Nop>
macm Window.Select\ Next\ Window key=<D-]> action=selectNextWindow:
macm Window.Select\ Previous\ Window key=<D-[> action=selectPreviousWindow:
#!/usr/local/bin/macruby
require 'rubygems'
require 'xcodeproj'
projpath = ARGV[0] + "/Unity-iPhone.xcodeproj"
proj = Xcodeproj::Project.new(projpath)
proj.targets.each do |target|
next unless target.name == "Unity-iPhone"
target.buildConfigurations.each do |config|
@splhack
splhack / gist:2583086
Created May 3, 2012 04:09
Use Xcode 4.3.2 as Xcode 4.2 or earlier without Command Line Tools
sudo mkdir /Developer
cd /Developer
sudo chown `id -u` .
ln -s /Applications/Xcode.app/Contents/Developer/* .
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs .
@splhack
splhack / org.grumpy-troll.EditWithEmacs-pycl.plist
Created June 27, 2012 00:00
~/Library/LaunchAgents/org.grumpy-troll.EditWithEmacs-pycl.plist
cp "Library/Application Support/Google/Chrome/Default/Extensions/ljobjlafonikaiipfkggjbhkghgicgoh/1.11_0/servers/pycl.py" /usr/local/bin
chmod 755 /usr/local/bin/pycl.py
@splhack
splhack / zaw.patch
Created December 6, 2012 02:15
Modify zaw filter as ST2 command palette
diff --git a/functions/filter-select b/functions/filter-select
index 7c747e6..8c501a1 100644
--- a/functions/filter-select
+++ b/functions/filter-select
@@ -560,9 +560,10 @@ function _filter-select-buffer-words() {
a=("${(@)${(@Qu)${(z)BUFFER}}//(#m)[()[\]#\|~]/\\${MATCH}}")
if ! zstyle -t ':filter-select' extended-search ; then
- if zstyle -t ':filter-select' case-insensitive; then
- : ${(A)a::=(#i)${^a}}
@splhack
splhack / Default.sublime-keymap
Created December 8, 2012 14:43
*Vim-ish* patches for Sublime Text 2
[
{
"keys": [
"escape"
],
"command": "run_macro_file",
"args": {
"file": "Packages/User/exit_insert_mode_as_vim.sublime-macro"
},
"context": [
@splhack
splhack / SampleTween.cs
Created December 20, 2012 02:55
Tween in LWF for Unity
movie.AddTween()
.Delay(30 /* frames */)
.Duration(60 /* frames */)
.X(360).Y(80).Rotation(359)
.SetEasing(Tween.Easing.Elastic.InOut)
.Start();
csharp/unity/renderer/common/lwf_unity_text.cs TextRenderer
TextRendererコンストラクタでGameObjectを生成しMeshFilter, MeshRendererをAddComponentする。
TextContext中のBitmapFontRendererインスタンスからmeshとmaterialをそれぞれsharedMesh,sharedMaterialに代入。
TextRenderer.Renderで、渡ってきたMatrix,ColorTransformを、このGameObjectに反映させる。
これらのGameObjectは、親のLWFObjectよりもZ的に手前になるように配置する(Unityに連続でテキストを描画させ、dynamic batchingされるようにするため)。
public void ApplyMatrix(GameObject gObj, ref Matrix4x4 m)
{
Transform transform = gObj.transform;
Vector3 v = vector;
v.x = m[0,3];
v.y = m[1,3];
v.z = m[2,3];
transform.localPosition = v;
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 17b78ce..e377ea1 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -1244,7 +1244,7 @@ zrefresh(void)
#ifdef __STDC_ISO_10646__
!ZSH_INVALID_WCHAR_TEST(*t) &&
#endif
- iswprint(*t) && (width = WCWIDTH(*t)) > 0) {
+ ISWPRINT(*t) && (width = WCWIDTH(*t)) > 0) {