- Login to the console on digitalocean website.
- Type sudo nano /etc/ssh/sshd_config
- Change PasswordAuthentication from “no” to “yes” and save the file
- Restart sshd (Debian:
sudo service sshd restart)
- Run `ssh-copy-id [user]@[hostname or IP address]
| python -m venv ./venv |
| import Foundation | |
| struct VersionNumber: Equatable, Comparable { | |
| let components: [Int] | |
| init(version: String?) { | |
| components = version?.split(separator: ".").compactMap({ Int($0) }) ?? [] | |
| } | |
| static func == (lhs: VersionNumber, rhs: VersionNumber) -> Bool { |
| // | |
| // UIImage+Resize.swift | |
| // | |
| // Created by Marcos Griselli on 6/9/17. | |
| // Copyright © 2017 Marcos Griselli. All rights reserved. | |
| // | |
| import Foundation | |
| import UIKit |
| func timeStringFromDate(_ date: Date) -> String? { | |
| let dateComponents = Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: date) | |
| let dateTimestamp = date.timeIntervalSince1970 | |
| let currentDateTimestamp = Date().timeIntervalSince1970 | |
| let diff: TimeInterval = currentDateTimestamp - dateTimestamp | |
| guard diff >= 0 else { | |
| return nil |
| import Foundation | |
| struct CountryCode: Codable { | |
| private class FooBar {} | |
| enum CodingKeys: String, CodingKey { | |
| case countryName = "name" | |
| case countryCode = "code" | |
| case countryDialCode = "dial_code" | |
| } |
A common task when developing iOS apps is to register custom cell subclasses for both UITableView and UICollectionView. Well, that is if you don’t use Storyboards, of course.
Both UITableView and UICollectionView offer a similar API to register custom cell classes:
public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)| Zip up your project: | |
| % zip –X –r ../index.zip * | |
| or if you use 7zip | |
| % 7z a ../index.zip * | |
| Then the aws cli lets you upload: | |
| % aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://../index.zip | |
| *****and maybe for you, the secret is |
#IRC Reference
Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.
##The Basics
/join #channel
/part #channel