Skip to content

Instantly share code, notes, and snippets.

View dive's full-sized avatar
👹

Artem Loenko dive

👹
View GitHub Profile
@dive
dive / resign.sh
Created September 14, 2012 14:58 — forked from RichardBronosky/resign.sh
A simple tool for resigning an iOS app ipa with a new certificate/mobileprovision
#!/usr/bin/env bash
if [[ ! ( # any of the following are not true
# 1st arg is an existing regular file
-f "$1" &&
# ...and it has a .ipa extension
"${1##*.}" == "ipa" &&
# 2nd arg is an existing regular file
-f "$2" &&
@dive
dive / reset_open_with.sh
Created October 3, 2012 16:15
Reset "Open with" list [Mac OS X]
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
@dive
dive / iso-639-1_from_russian_names.m
Created October 31, 2012 21:52
languages value from russian names
//
// main.m
// LocaleChecker
//
// Created by Artyom Loenko on 11/1/12.
// Copyright (c) 2012 Artyom Loenko. All rights reserved.
//
#import <Foundation/Foundation.h>
@dive
dive / self.self.self.m
Last active December 16, 2015 17:09
Self abandoned by self abandoned.
#import <Foundation/Foundation.h>
@interface TestSelfSelfer : NSObject
@property (nonatomic, strong) NSString *string;
@property (nonatomic, strong) TestSelfSelfer *sself;
@end
@implementation TestSelfSelfer
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"
@dive
dive / shouldStartLoadWithRequest_signature.m
Last active August 29, 2015 14:05
shouldStartLoadWithRequest
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
@dive
dive / debug_embedded_uiwebview.m
Last active August 29, 2015 14:05
Debug embedded UIWebView
#if TARGET_IPHONE_SIMULATOR
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
[NSClassFromString(@"WebView") performSelector:@selector(_enableRemoteInspector)];
#pragma clang diagnostic pop
#endif
@dive
dive / fix_google_drive_icon_black.sh
Last active August 29, 2015 14:13
Quick fix for Google Drive icon for dark menu bar (OS X 10.10)
#!/bin/sh
GOOGLE_DRIVE_DEFAULT_PATH=/Applications/Google\ Drive.app/Contents/Resources
# backup
find "$GOOGLE_DRIVE_DEFAULT_PATH"/ -type f -name 'mac-normal*.png' -exec cp -v '{}' '{}'.backup \;
# copy all needed files to tmp
cp -f -v "$GOOGLE_DRIVE_DEFAULT_PATH"/mac-normal*.png /tmp/
import UIKit
public final class FrameworkPackage {
public init () { }
public func randomColor() -> UIColor {
return UIColor.random
}
}
public extension UIColor {
import UIKit
import class ios_framework_package.FrameworkPackage
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = FrameworkPackage().randomColor()
}