Skip to content

Instantly share code, notes, and snippets.

🏎
Focusing

metasmile

🏎
Focusing
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
View ava.md

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 Aug 25, 2015
a macro for support ios9's new typed iterable.
View TypedIterableCapabilty.h
#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 *
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
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{
//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 Oct 2, 2014
extract average color from image and color sorting
View gen.py
import time
import os
import subprocess
import sys
import re
import uuid
import json
import colorsys
import filecmp
@metasmile
metasmile / get_colors.py
Created Oct 2, 2014
getting color from image file (using k-means)
View get_colors.py
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'))
View 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 Dec 23, 2011
Image RedEye Remove
View redEyeRemove.as
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;
You can’t perform that action at this time.