Skip to content

Instantly share code, notes, and snippets.

View metasmile's full-sized avatar
🏎️
Focusing

gitmerge metasmile

🏎️
Focusing
View GitHub Profile

Introduction

  • 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.

Elements

  • 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
metasmile / TypedIterableCapabilty.h
Last active January 27, 2021 06:48
a macro for support ios9's new typed iterable.
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000
#define __typed_iterable(iterablesCls, elementsType) iterablesCls<elementsType> *
#else
#define __typed_iterable(iterablesCls, elementsType) iterablesCls *
#endif
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000
#define __ktyped_iterable(iterablesCls, elementsType) iterablesCls<__kindof elementsType> *
#else
#define __ktyped_iterable(iterablesCls, elementsType) iterablesCls *
@metasmile
metasmile / dealloc_in_category.h
Created August 20, 2015 11:57
dealloc in category
#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
metasmile / gist:16ff11ba0b24018b1fcc
Created August 20, 2015 05:24
Dynamically measure chest point from face by orientation
- (CGPoint)calculateChestPointFromFace:(CGPoint)facePoint faceFrame:(CGRect)faceFrame inBounds:(CGRect)bounds{
//define
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
metasmile / gen.py
Created October 2, 2014 15:23
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
metasmile / get_colors.py
Created October 2, 2014 15:20
getting color from image file (using k-means)
from collections import namedtuple
from math import sqrt
import random
try:
import Image
except ImportError:
from PIL import Image
Point = namedtuple('Point', ('coords', 'n', 'ct'))
Cluster = namedtuple('Cluster', ('points', 'center', 'n'))
@metasmile
metasmile / ipin.py
Last active August 29, 2015 14:07 — forked from urielka/ipin.py
#---
# iPIN - iPhone PNG Images Normalizer v1.0
# Copyright (C) 2007
#
# Author:
# Axel E. Brzostowski
# http://www.axelbrz.com.ar/
# axelbrz@gmail.com
#
# References:
@metasmile
metasmile / redEyeRemove.as
Created December 23, 2011 06:25
Image RedEye Remove
public static function redEyeRemove(targetRect:Rectangle, targetBitmapData:BitmapData, outterCoverage:int=3):void {
var rect:Rectangle = targetRect.clone();
rect.left -= outterCoverage;
rect.top -= 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;