Skip to content

Instantly share code, notes, and snippets.



Block or report user

Report or block metasmile

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile


  • The limited topological representations about all things of us. Especially It is dealing with the activity-idea chain. Inspired by the universe we know.
  • A model for the consistent stream of consciousness, managing and expanding values, resources, businesses, organizations, goals, concepts, technologies, projects, results, finally mutual complementary relationships between them all.
  • Not a tree.


  • AGN: The mission.
  • Quasar: Core concept generator. Technology and research approach.
  • Seyfert: Core strategy generator. Business and product approach. Generates references and products
  • Blazar: A concept including all kinds of the realizable idea and its materials.
metasmile / TypedIterableCapabilty.h
Last active Aug 25, 2015
a macro for support ios9's new typed iterable.
View TypedIterableCapabilty.h
#define __typed_iterable(iterablesCls, elementsType) iterablesCls<elementsType> *
#define __typed_iterable(iterablesCls, elementsType) iterablesCls *
#define __ktyped_iterable(iterablesCls, elementsType) iterablesCls<__kindof elementsType> *
#define __ktyped_iterable(iterablesCls, elementsType) iterablesCls *
View dealloc_in_category.h
#define BEGIN_DEALLOC_CATEGORY + (void)load {\
SEL originalSelector = NSSelectorFromString(@"dealloc");\
SEL overrideSelector = @selector(__dealloc__);\
Method originalMethod = class_getInstanceMethod(self, originalSelector);\
Method overrideMethod = class_getInstanceMethod(self, overrideSelector);\
if (class_addMethod(self, originalSelector, method_getImplementation(overrideMethod), method_getTypeEncoding(overrideMethod))) {\
class_replaceMethod(self, overrideSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));\
} else {\
method_exchangeImplementations(originalMethod, overrideMethod);\
metasmile / gist:16ff11ba0b24018b1fcc
Created Aug 20, 2015
Dynamically measure chest point from face by orientation
View gist:16ff11ba0b24018b1fcc
- (CGPoint)calculateChestPointFromFace:(CGPoint)facePoint faceFrame:(CGRect)faceFrame inBounds:(CGRect)bounds{
UIInterfaceOrientation currentOrientation = [STMotionManager sharedManager].interfaceOrientation;
CGPoint focusPointHeadBottomToBody = facePoint;
CGFloat totalLengthVertical = UIInterfaceOrientationIsPortrait(currentOrientation) ? bounds.size.height : bounds.size.width;
CGFloat faceLengthVertical = UIInterfaceOrientationIsPortrait(currentOrientation) ? faceFrame.size.height : faceFrame.size.width;
//calc focus point ~ bottom
CGFloat perToHeadToTotalLength = 1.5f;
CGFloat addedLengthHeadToTotalLength = 0;
metasmile /
Created Oct 2, 2014
extract average color from image and color sorting
import time
import os
import subprocess
import sys
import re
import uuid
import json
import colorsys
import filecmp
metasmile /
Created Oct 2, 2014
getting color from image file (using k-means)
from collections import namedtuple
from math import sqrt
import random
import Image
except ImportError:
from PIL import Image
Point = namedtuple('Point', ('coords', 'n', 'ct'))
Cluster = namedtuple('Cluster', ('points', 'center', 'n'))
# iPIN - iPhone PNG Images Normalizer v1.0
# Copyright (C) 2007
# Author:
# Axel E. Brzostowski
# References:
metasmile /
Created Dec 23, 2011
Image RedEye Remove
public static function redEyeRemove(targetRect:Rectangle, targetBitmapData:BitmapData, outterCoverage:int=3):void {
var rect:Rectangle = targetRect.clone();
rect.left -= outterCoverage; -= outterCoverage;
rect.bottom += outterCoverage;
rect.right += outterCoverage;
var r:Number = (rect.width*.5) - outterCoverage;
var x1:Number = rect.x;
var x2:Number = rect.width + rect.x;
You can’t perform that action at this time.