Skip to content

Instantly share code, notes, and snippets.

View 2bbb's full-sized avatar

2bit 2bbb

View GitHub Profile
@2bbb
2bbb / NSMutableArray+TBAddObjectExtention.h
Created October 18, 2012 08:25
NSArray / NSMutableArray Add/Get ShortCut
//
// NSMutableArray+TBAddObjectExtention.h
//
// Created by ISHII Tsuubito on 12/10/18.
// Copyright (c) 2012 buffer Renaiss co., ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
#pragma mark get
@2bbb
2bbb / NSMutableArray+TBAddObjectExtention.m
Created October 18, 2012 08:26
NSArray / NSMutableArray Add/Get ShortCut
//
// NSMutableArray+TBAddObjectExtention.m
//
// Created by ISHII Tsuubito on 12/10/18.
// Copyright (c) 2012年 buffer Renaiss co., ltd. All rights reserved.
//
#import "NSMutableArray+TBAddObjectExtention.h"
#pragma mark getter
@2bbb
2bbb / JavaScriptTemplate
Created November 14, 2012 20:17
JavaScript Template Test
var template = (function() {
var defaultNeedle = new RegExp(/__(.+?)__/g);
return function(template, obj, needle) {
needle = needle || defaultNeedle;
var evalString = '"' + template.replace(needle, "\"+obj.$1+\"") + '"';
if(obj["length"] && obj["push"]) {
var src = obj, dst = [];
for(var i = 0; i < src.length; i++) {
obj = src[i];
dst.push(eval(evalString));
@2bbb
2bbb / ArrayExtention.js
Last active December 15, 2015 11:58
JavaScript Math Extention
/*
JavaScript Array Extention
v0.1
2013 [c] ISHII 2bit
Author : ISHII 2bit
E-Mail : ishii [ at ] buffer-renaiss.com
Web : http://2bit.jp/
Update :
@2bbb
2bbb / TBLogger.h
Last active December 20, 2015 04:09
Logger for Objective-C (require with XcodeColors)
//
// TBLogger.h
//
// Created by ISHII 2bit
// Copyright (c) 2013 buffer Renaiss co., ltd. All rights reserved.
//
// require (if use with Xcode) : https://github.com/robbiehanson/XcodeColors/downloads
//
#ifndef __TBLogger_h__
@2bbb
2bbb / .gitignore
Created August 19, 2013 21:56
.DS_Store Collector
*.*
!.DS_Store
@2bbb
2bbb / prfmlv3logo_2b.pde
Last active August 29, 2015 13:59
from micromeeeter
// https://gist.github.com/micromeeeter/10586065
void setup(){
colorMode(HSB,360,100,100);
size(600,600);
background(1,0,99);
stroke(189,99,99);
strokeWeight(1);
frameRate(20);
}
@2bbb
2bbb / pointer.hpp
Created April 18, 2014 23:46
pointer
#define Pointer(T) T *
#define ImmutableValuePointer(T) const T *
#define ImmutableAddressPointer(T) T * const
#define ImmutablePointer(T) const T * const
template <typename T>
class Pointer {
public:
typedef T *type;
typedef const T * immutableValue;
@2bbb
2bbb / app.js
Created April 19, 2014 08:36
artnet_sender
// npm install artnet-node
// npm install node-osc
var clientIP = "192.168.1.102"; // set correct IP
var port = 6454,
Artnet = require('artnet-node'),
ArtnetClient = Artnet.Client,
OSC = require('node-osc');
@2bbb
2bbb / hsv2rgb.js
Last active August 29, 2015 14:00
hsv2rgb.js
inlets = 1;
outlets = 3;
function hsb(h, s, v) {
s = (s == undefined) ? 255.0 : s;
v = (v == undefined) ? 255.0 : v;
if(s == 0) {
outlet(0, v);
outlet(1, v);
outlet(2, v);