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 / AA3D.cs
Created August 29, 2013 08:32
3Dプログラムで使えるAA集
/*=======
a-----b
/| /|
c-+---d |
| e---|-f
|/ |/
g-----h
@asus4
asus4 / LotteryRandom.cs
Created October 3, 2013 14:21
Random class. but inconsecutive value, like Lottery.
using System.Linq;
using System.Collections.Generic;
namespace ExMath {
/// <summary>
/// Lottery random.
/// </summary>
public class LotteryRandom <T> {
@asus4
asus4 / autobuild.sh
Created October 31, 2013 15:32
Build script for openFrameworks RaspberryPI
#!/bin/sh
git pull
make
./bin/testApp
@asus4
asus4 / config.json
Created December 2, 2013 11:51
picojsonを使ってoF環境設定ファイルを読み書き ref: http://qiita.com/asus4/items/641fc63348c0dfa5c797
{
"LV":3,
"HP":1,
"MP":1,
"sleepy":false,
"hungry":true,
"status":"カレー食べたい"
}
@asus4
asus4 / notification.sh
Created January 1, 2014 07:25
長いコマンドの後にノーティフィケーションをいれる
echo "some long command" && echo 'display notification "Finished backup" with title "Terminal"' | osascript
@asus4
asus4 / NSArrayController+Addition.h
Created January 24, 2014 07:04
NSArrayController+Addition
#import <Cocoa/Cocoa.h>
@interface NSArrayController (Addition)
- (void) removeAllObjects;
@end
@asus4
asus4 / NativeMenuBuilder.as
Last active November 14, 2017 19:03
Create Air apllication's native menu easy
package com.github.asus4.aslib.app
{
import flash.desktop.NativeApplication;
import flash.display.NativeMenu;
import flash.display.NativeMenuItem;
import flash.events.Event;
/**
* Cretae Native Menu easy
*
@asus4
asus4 / shortvibratetime.mm
Last active January 31, 2018 14:44
Less than one second vibration for iOS
double length = 0.1;
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(length * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// private method
AudioServicesStopSystemSound(kSystemSoundID_Vibrate);
});
@asus4
asus4 / LittleCaffeine.h
Last active March 11, 2024 15:16
Prevent sleep and screensaver while the application running. ref: http://qiita.com/asus4/items/02b5096a937bbd419f3e
//
// LittleCaffeine.h
//
// This is tiny utility inspired by Caffeine http://lightheadsw.com/caffeine/
//
// Created by Koki Ibukuro on 2014/04/01.
// Copyright (c) 2014年 Koki Ibukuro. All rights reserved.
//
#pragma once
@asus4
asus4 / m_conf.c
Created April 3, 2014 10:07
PD for iOS版にないオブジェクトの追加の仕方。 ref: http://qiita.com/asus4/items/c758aaa560c458d9bbb9
// ....
void d_soundfile_setup(void);
void d_ugen_setup(void);
// こんなかんじで
void your_extended_setup(void);
// ....