Skip to content

Instantly share code, notes, and snippets.

View mkll's full-sized avatar
😎

Alex Sherbakov mkll

😎
  • Home Sweet Home
View GitHub Profile
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
- (NSString *) platform;
@mkll
mkll / CoreLocationTest.m
Created September 28, 2016 20:02 — forked from tmiz/CoreLocationTest.m
Using CoreLocation on Mac OS X with command-line
//
// Using CoreLocation on Mac OS X with command-line
// $ clang CoreLocationTest.m -framework cocoa -framework CoreLocation
// $ ./a.out
// location service enabled
// 2011-12-01 21:03:01.839 a.out[10214:903] latitude,logitude : 35.606647, 140.695538
// 2011-12-01 21:03:01.842 a.out[10214:903] timestamp : 2011-12-01 21:01:36 +0900
// tmiz moo@tmiz.net
//
#import <cocoa/cocoa.h>
#import <Foundation/Foundation.h>
@interface NSBundle (Language)
+(void)setLanguage:(NSString*)language;
@end
@mkll
mkll / openBLESetting
Created June 21, 2018 19:47 — forked from johnny77221/openBLESetting
opening iOS BLE setting from app
NSURL *bluetoothURLOS8 = [NSURL URLWithString:@"prefs:root=General&path=Bluetooth"];
NSURL *bluetoothURLOS9 = [NSURL URLWithString:@"prefs:root=Bluetooth"];
NSURL *bluetoothURLOS10 = [NSURL URLWithString:@"Prefs:root=Bluetooth"];
if ([[[UIDevice currentDevice] systemVersion] intValue] >= 10) {
Class<NSObject> workSpaceClass = NSClassFromString(@"LSApplicationWorkspace");
if (workSpaceClass) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
id workSpaceInstance = [workSpaceClass performSelector:NSSelectorFromString(@"defaultWorkspace")];
SEL selector = NSSelectorFromString(@"openSensitiveURL:withOptions:");
@mkll
mkll / gist:12f317fe001747c597c9967bef838669
Created August 2, 2018 14:34 — forked from mestizo/gist:9167834
Completely disable IPv6 on OSX
#To Get List of Hardware
sudo networksetup -listallhardwareports
#To Disable IPv6 on Wifi Adapter
sudo networksetup -setv6off wi-fi
#To Disable IPv6 on Built-in Ethernet Adapter
sudo networksetup -setv6off Ethernet
@mkll
mkll / wifi_scan.m
Created August 21, 2018 07:27 — forked from pavel-a/wifi_scan.m
Wi-Fi scan for Apple OS X (maybe works for iOS too)
/* The official example for CoreWLAN is now obsolete,
so here's a small command-line example that works with Xcode 6 and Yosemite.
It only demonstrates how to get basic wi-fi connection properties and scan.
Enjoy!
pavel_a@fastmail.fm 01-Mar-2015
*/
#import <Foundation/Foundation.h>
#import <CoreWLAN/CoreWLAN.h>
#include <stdio.h>
@mkll
mkll / macosx-configure-postfix-as-relay.md
Created August 27, 2018 12:24 — forked from loziju/macosx-configure-postfix-as-relay.md
Configure postfix as relay for OS X
@mkll
mkll / install_hpn-ssh.md
Created September 10, 2018 00:55
Install HPN-SSH
@mkll
mkll / gist:08de2b0024e292ded7fc9db302841cb5
Created March 9, 2019 20:56 — forked from Atem18/gist:4696071
Tutorial to seting up a django website in production.

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@mkll
mkll / Tabbar.Swift
Created April 4, 2019 12:59 — forked from calt/Tabbar.Swift
UITabBar with custom height in Swift
extension UITabBar {
override public func sizeThatFits(size: CGSize) -> CGSize {
super.sizeThatFits(size)
var sizeThatFits = super.sizeThatFits(size)
sizeThatFits.height = 71
return sizeThatFits
}
}