I hereby claim:
- I am tmm on github.
- I am meagher (https://keybase.io/meagher) on keybase.
- I have a public key whose fingerprint is D55C 2C17 A325 D985 CC01 0746 FDF6 0FC5 7C9E B567
To claim this, I am signing this object:
| import UIKit | |
| //"USA", return true | |
| //"Calvin", return true | |
| //"compUter", return false | |
| //"coding", return true | |
| func isUppercase(character: Character) -> Bool { | |
| String(character) == character.uppercased() | |
| } |
| import UIKit | |
| extension String { | |
| func isAlphanumeric() -> Bool { | |
| return self.rangeOfCharacter(from: CharacterSet.alphanumerics.inverted) == nil && self != "" | |
| } | |
| func isAlphanumeric(ignoreDiacritics: Bool = false) -> Bool { | |
| if ignoreDiacritics { return self.range(of: "[^a-zA-Z0-9]", options: .regularExpression) == nil && self != "" } | |
| else { return self.isAlphanumeric() } |
| import Foundation | |
| struct ProjectUser: Codable { | |
| var id: Int | |
| enum CodingKeys: String, CodingKey { | |
| case id = "userId" | |
| } | |
| } |
| import { useEffect, useRef } from 'react' | |
| export function useMount(callback) { | |
| useEffect(callback, []) | |
| } | |
| export function usePrevious(value) { | |
| const ref = useRef() | |
| useEffect(() => (ref.current = value)) | |
| return ref.current |
| # configuration for cloudflare | |
| CLOUDFLARE_EMAIL="[email protected]" | |
| CLOUDFLARE_API_KEY="sdfsafsdafadsdsaf" | |
| DOMAIN="example.com" | |
| # as root configure your cloudflare secrets | |
| mkdir -p .secrets | |
| cat <<CLOUDFLARE_CONFIG > .secrets/cloudflare.ini | |
| dns_cloudflare_email="$CLOUDFLARE_EMAIL" | |
| dns_cloudflare_api_key="$CLOUDFLARE_API_KEY" |
| import CryptoJS from 'crypto-js' | |
| const GDAX_SECRET = 'PYPd1Hv4J6/7x...'; | |
| const getGdaxSignature = (endpoint, body = '') => { | |
| const timestamp = Date.now() / 1000; | |
| const body = JSON.stringify(body); | |
| const message = timestamp + method + endpoint + body; // create prehash string by concatenating required parts | |
| const key = CryptoJS.enc.Base64.parse(GDAX_SECRET); // Base64 decode the alphanumeric secret string | |
| const signedMessage = CryptoJS.HmacSHA256(message, key); // use it as key for SHA 256 HMAC |
| mkvirtualenv -p /usr/local/bin/python3.5 <name of venv> |
I hereby claim:
To claim this, I am signing this object:
| var a = 5 | |
| var b = 3 | |
| a += b | |
| b = a - b | |
| a = a - b | |
| print("a: \(a)") // 3 | |
| print("b: \(b)") // 5 |
| // Option 1 - For portrait orientation only | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| tableView.rowHeight = UITableViewAutomaticDimension | |
| tableView.estimatedRowHeight = 160.0 | |
| } | |
| // Option 2 - For both portrait and landscape orientations | |
| override func viewDidLoad() { | |
| super.viewDidLoad() |