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 MapKit | |
| class LocationController: NSObject, MKLocalSearchCompleterDelegate { | |
| func completerDidUpdateResults(_ completer: MKLocalSearchCompleter) { | |
| print(completer.results, "\n--------------------------\n") | |
| } | |
| } | |
| var locationController = LocationController() |
Based on some source I don't exactly remember right now but will add a link to later.
// When used on instances, allows changing fields directly using keypaths (handy way to avoid 'lazy var' property closures!)
let label
= UILabel()
.with(\.text, setTo: "Hello!")
.with(\.textColor, setTo: UIColor.darkGray)
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 UIKit | |
| import MobileCoreServices | |
| import ImageIO | |
| let sourceOptions: [String: AnyObject] = [kCGImageSourceTypeIdentifierHint as String: kUTTypeJPEG] | |
| let cfSourceOptions = sourceOptions as CFDictionary | |
| let image = UIImage(named: "input.jpg")! | |
| let data = UIImageJPEGRepresentation(image, 1.0) |
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
| // | |
| // Generate EXIF GPS metadata | |
| // Swift 3 | |
| // Exif Version 2.2.0.0 supports decimal degrees | |
| import Foundation | |
| import CoreLocation | |
| import ImageIO | |
| extension CLLocation { |
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
| val audioRecordAdapter = ItemAdapter(data) | |
| val sections = mutableListOf<Section>() | |
| sections.add(DateSection(0, "Today")) | |
| sections.add(DateSection(2, "15/05/2016")) | |
| val customSectionAdapter = CustomSectionAdapter() | |
| customSectionAdapter.configSections(sections) | |
| val sectionAdapter = SectionedRecyclerViewAdapter(customSectionAdapter, audioRecordAdapter) |
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
| /* | |
| mMap.addMarker(new MarkerOptions() | |
| .position(new LatLng(latitude, longitude)) | |
| .title("Marker Title") | |
| .snippet("Marker snippet") | |
| .icon(getBitmapDescriptor(R.drawable.ic_place_black_48dp))); | |
| */ | |
| private BitmapDescriptor getBitmapDescriptor(int id) { | |
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
Document moved to: https://github.com/servo/servo/blob/master/HACKING_QUICKSTART.md
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
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <meta name="description" content=""> | |
| <meta name="keywords" content=""> | |
| <meta name="author" content=""> | |
| <title>E-Signature</title> |
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
| var Sequelize = require('sequelize'); | |
| module.exports = function(config) { | |
| var models = {}; | |
| sequelize = new Sequelize(config.database, config.username, config.password, config.options); | |
| // Bootstrap models | |
| fs.readdirSync(__dirname).forEach(function (file) { |
NewerOlder