Skip to content

Instantly share code, notes, and snippets.

View asus4's full-sized avatar
:octocat:
Working from home

Koki Ibukuro asus4

:octocat:
Working from home
View GitHub Profile
@asus4
asus4 / win8_icon_export.zsh
Last active August 29, 2015 14:01
Windows8 icon resize script
#!/bin/zsh
# consts
EXPORT_DIR=Icons
FILE_WIDE=logo_wide.png
FILE_SQUARE=logo_square.png
# input folder
function mkdir_ex() {
# create folder
@asus4
asus4 / sample.m
Last active August 29, 2015 14:02
Create Mac native key events ref: http://qiita.com/asus4/items/a2517aed8dc7e4773c34
- (void) keyEmulate {
CGEventRef keyup, keydown;
keydown = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)40, true);
keyup = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)40, false);
CGEventPost(kCGHIDEventTap, keydown);
CGEventPost(kCGHIDEventTap, keyup);
CFRelease(keydown);
CFRelease(keyup);
}
@asus4
asus4 / ofxLPF.cpp
Created June 17, 2014 12:36
Simple Low Pass Filter for openFrameworks
//
// ofxLPF.cpp
// Simple Low Pass Filter
//
// Created by Koki Ibukuro on 6/17/14.
//
//
//http://baumdevblog.blogspot.jp/2010/11/butterworth-lowpass-filter-coefficients.html
@asus4
asus4 / MaskedSprite.shader
Created June 29, 2014 20:03
Play Movie Texture with Mask
Shader "Custom/MaskedSprite" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags {
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
@asus4
asus4 / ShellScript.h
Created July 3, 2014 17:28
Call shell-script from Objective-C, Swift
//
// ShellScript.h
//
// Created by Koki Ibukuro on 6/18/14.
// Copyright (c) 2014 Koki Ibukuro. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef void (^ShellScriptMessageCallback)(NSString* msg);
import Cocoa
class SoundManager {
struct Cache {
static let sound = Dictionary<String, NSSound>()
}
@asus4
asus4 / SOX normalize
Last active August 29, 2015 14:04
soxで全部の音をノーマライズ ref: http://qiita.com/asus4/items/0540445362e7eef3491f
brew install sox
@asus4
asus4 / convertflv.zsh
Created August 2, 2014 12:53
convert all mov files to flv
#!/bin/zsh
# normalize
function toflv() {
ffmpeg -i $1 -acodec copy -vcodec copy ${1%.mov}.flv
}
while [ "$1" != "" ]
do
toflv $1
@asus4
asus4 / angular-audio.coffee
Created August 4, 2014 10:59
Simple sound effect module for AngularJS
# This is Simple Audio Plugin for AngularJS
# service
class AngularAudio
constructor:() ->
@cache = {}
play:(id) ->
audio = null
@asus4
asus4 / wav2caf.sh
Created November 6, 2014 14:38
Convert Wave audio to Caf format
#!/bin/sh
for file in *.wav
do
/usr/bin/afconvert -f caff -d ima4@22050 -c 1 $file ${file%.wav}.caf
done