This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| import SwiftUI | |
| struct ContentView: View { | |
| private let columns = [ | |
| GridItem(.flexible()), | |
| GridItem(.flexible()), | |
| GridItem(.flexible()) | |
| ] | |
| @State private var visibleIndex: Int? = nil |
| import SafariServices | |
| import SwiftUI | |
| import UIKit | |
| /// A SwiftUI view that wraps SFSafariViewController | |
| struct SafariView: UIViewControllerRepresentable { | |
| private let url: URL | |
| init(url: URL) { | |
| self.url = url |
| from pbxproj import XcodeProject | |
| import os | |
| from glob import glob | |
| import collections | |
| import sys | |
| TYPE_OF_FILE = 'swift' | |
| # Get all files in project folder | |
| project_folder_path = sys.argv[1] |
| #!/bin/bash | |
| set -e | |
| CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc) | |
| hex=$((cat <<EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> |
| import Darwin | |
| extension Int { | |
| static func random() -> Int { | |
| return Int(arc4random()) | |
| } | |
| static func random(range: Range<Int>) -> Int { | |
| return Int(arc4random_uniform(UInt32(range.endIndex - range.startIndex))) + range.startIndex | |
| } |
| <% flash.each do |type, message| %> | |
| <div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
| <button class="close" data-dismiss="alert">×</button> | |
| <%= message %> | |
| </div> | |
| <% end %> |
| for f in *; do mv $f `echo $f | ruby -e 'puts gets.downcase'`; done |
| #import <Foundation/Foundation.h> | |
| @interface NSURL (Pieces) | |
| -(NSDictionary *)piecesDictionary; | |
| @end |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| // WeakReferenceSet.h | |
| // Created by [email protected] on 21/06/11. | |
| #import <Foundation/Foundation.h> | |
| @interface WeakReferenceSet : NSObject | |
| + (WeakReferenceSet*)set; | |
| - (void)addObject:(id)object; | |
| - (void)removeObject:(id)object; |