This file contains 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 Combine | |
import Foundation | |
enum CustomError: Error { | |
case retryError | |
case otherError | |
} | |
var count = 0 |
This file contains 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
require 'rss' | |
require "csv" | |
rss_source = File.new('feed.xml') | |
rss = RSS::Parser.parse(rss_source, false) | |
CSV.open('test.csv','w') do |csv| | |
rss.items.each do |item| | |
title = item.title | |
date = item.pubDate.localtime.strftime('%Y/%m/%d') |
This file contains 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
// Swift 3 | |
import UIKit | |
class TestViewController: UIViewController { | |
var text: String! | |
static func create(with text: String) -> Self { | |
let vc = instantiateFromStoryboard() |
This file contains 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
openssl asn1parse -inform DER -in foo.mobileprovision |
This file contains 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
- (NSDictionary *)embeddedMobileprovisionPlist | |
{ | |
NSString *path = [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]; | |
if (!path) { | |
return nil; | |
} | |
NSData *profileData = [NSData dataWithContentsOfFile:path]; | |
if (!profileData) { | |
return nil; |
This file contains 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; | |
#import <SystemConfiguration/CaptiveNetwork.h> | |
- (NSString *)currentSSID | |
{ | |
NSArray *interfaceNames = CFBridgingRelease(CNCopySupportedInterfaces()); | |
if (!interfaceNames.count) { | |
return nil; | |
} |
This file contains 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
BOOL isEqual(NSObject *a, NSObject *b) | |
{ | |
if (a) { | |
if (b) { | |
return [a isEqual:b]; | |
} | |
} else { // a == nil | |
if (!b) { | |
return YES; | |
} |
This file contains 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
require 'osx/cocoa' | |
data = OSX::NSPropertyListSerialization.dataWithPropertyList_format_options_error_(obj, OSX::NSPropertyListBinaryFormat_v1_0, 0, nil) | |
data.writeToFile_atomically_(path, true) |
NewerOlder