This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const blacklist = require('metro-bundler/src/blacklist'); | |
module.exports = { | |
getBlacklistRE: function() { | |
return blacklist([/[^e]\/node_modules\/react-native\/.*/]); | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: `python ~/Desktop/contours.py 1994-654-12_v02.tif` | |
# output is to a squareless.txt file and the directory "out" | |
# Working well with thumbnails with 400px as their longest side - untested with other dimensions | |
# for i in $(ls -1 | grep tif); do python /Users/artsyinc/Documents/resistance/experiments/artwork_image_cropping/contours.py $i; done | |
import cv2 | |
import numpy as np | |
from matplotlib import pyplot as plt | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+(double)distanceBetweenPoint:(CGPoint)pointA andAnotherPoint:(CGPoint)pointB | |
{ | |
return sqrt((pointA.x - pointB.x)*(pointA.x - pointB.x) + (pointA.y - pointB.y)*(pointA.y - pointB.y)); | |
} | |
+(NSArray *)findPointOnTangentOnCircleWithCenter:(CGPoint)center Radius:(double)radius pointOnTangent:(CGPoint)point | |
{ | |
double dx = center.x - point.x; | |
double dy = center.y - point.y; | |
double distance = [EXMathBrain distanceBetweenPoint:center andAnotherPoint:point]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <SystemConfiguration/CaptiveNetwork.h> | |
- (id)fetchSSIDInfo | |
{ | |
NSArray *ifs = (__bridge id)CNCopySupportedInterfaces(); | |
NSLog(@"%s: Supported interfaces: %@", __func__, ifs); | |
id info = nil; | |
for (NSString *ifnam in ifs) { | |
info = (__bridge id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam); | |
NSLog(@"%s: %@ => %@", __func__, ifnam, info); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.mask = @"111-222-3333"; | |
- (BOOL)textField:(UITextField *)textField | |
shouldChangeCharactersInRange:(NSRange)range | |
replacementString:(NSString *)string | |
{ | |
if (textField.tag == 5) | |
{ | |
//If the length of used entered text is equals to mask length the user input must be cancelled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import mach/mach.h | |
void report_memory(void) { | |
struct task_basic_info info; | |
mach_msg_type_number_t size = sizeof(info); | |
kern_return_t kerr = task_info(mach_task_self(), | |
TASK_BASIC_INFO, | |
(task_info_t)&info, | |
&size); | |
if( kerr == KERN_SUCCESS ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UIImage *)fixOrientation { | |
// No-op if the orientation is already correct | |
if (self.imageOrientation == UIImageOrientationUp) return self; | |
// We need to calculate the proper transformation to make the image upright. | |
// We do it in 2 steps: Rotate if Left/Right/Down, and then flip if Mirrored. | |
CGAffineTransform transform = CGAffineTransformIdentity; | |
switch (self.imageOrientation) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UIToolbar (CustomImage) | |
@end |
NewerOlder