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 SwiftUI | |
struct AdaptiveStack<Content: View>: View { | |
@Environment(\.horizontalSizeClass) var sizeClass | |
let horizontalAlignment: HorizontalAlignment | |
let verticalAlignment: VerticalAlignment | |
let spacing: CGFloat? | |
let isVertical: Bool? | |
let content: () -> Content |
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 logging | |
import os | |
from typing import List | |
import gpxpy | |
# Use | |
# Put the GPX files you want to parse in a folder 'gpx_files' next to this file | |
# Execute the file in a terminal: 'python3 parse_gpx.py' | |
# The output GPX files will be in a folder called 'parsed_files' |
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
//... | |
do { | |
let model = try jsonDecoder.decode(BattleShip.self, from: jsonData!) | |
print(model) | |
} catch DecodingError.dataCorrupted(let context) { | |
print(context.debugDescription) | |
} catch DecodingError.keyNotFound(let key, let context) { | |
print("\(key.stringValue) was not found, \(context.debugDescription)") | |
} catch DecodingError.typeMismatch(let type, let context) { | |
print("\(type) was expected, \(context.debugDescription)") |
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 WebKit | |
class NativeWebViewController: UIViewController { | |
let viewportScriptString = "var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', 'width=device-width'); meta.setAttribute('initial-scale', '1.0'); meta.setAttribute('maximum-scale', '1.0'); meta.setAttribute('minimum-scale', '1.0'); meta.setAttribute('user-scalable', 'no'); document.getElementsByTagName('head')[0].appendChild(meta);" | |
let disableSelectionScriptString = "document.documentElement.style.webkitUserSelect='none';" | |
let disableCalloutScriptString = "document.documentElement.style.webkitTouchCallout='none';" | |
override func viewDidLoad() { | |
// 1 - Make user scripts for injection |
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
module Fastlane | |
module Actions | |
class AddIconOverlayAction < Action | |
def self.run(params) | |
Helper.log.info "Image to overlay on icons: #{params[:overlay_image_path]}" | |
require 'mini_magick' | |
appiconset = params[:appiconset_path] |
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
## Collection of posts/videos I've found useful while researching mvvm | |
https://speakerdeck.com/jspahrsummers/code-reuse-with-mvvm | |
http://cocoasamurai.blogspot.com/2013/03/basic-mvvm-with-reactivecocoa.html | |
http://www.teehanlax.com/blog/model-view-viewmodel-for-ios/ | |
http://martinfowler.com/eaaDev/PresentationModel.html | |
http://twocentstudios.com/blog/2014/06/08/on-mvvm-and-architecture-questions/ |
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
You need to add a collection | |
namespace :api do | |
namespace :v1 do | |
resources :users do | |
collection do | |
get 'all' | |
end | |
end | |
resources :sessions |
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 <Foundation/Foundation.h> | |
@interface NSObject (NSDictionaryRepresentation) | |
/** | |
Returns an NSDictionary containing the properties of an object that are not nil. | |
*/ | |
- (NSDictionary *)dictionaryRepresentation; | |
@end |
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
#!/bin/bash | |
# automation.sh | |
# Created by @idStar - Sohail Ahmed - September 2, 2012 | |
# This script launches the UIAutomation Instrument targeting a pre-existing iOS Simulator app, from the command line. | |
# Works with Xcode 4.4.1 on Mountain Lion | |
# | |
# Usage: | |
# automation <"App Name.app"> <"testFile.js"> <"base test script path"> <"base iOS Simulator path"> <"results output directory"> | |
# |
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
#!/usr/bin/env bash | |
uninstall() { | |
list=`gem list --no-versions` | |
for gem in $list; do | |
gem uninstall $gem -aIx | |
done | |
gem list | |
gem install bundler | |
} |
NewerOlder