git
commands to update local copy when default branch name has been changed from master
to main
:
git branch -m master main
git fetch origin
git branch -u origin/main main
git
commands to update local copy when default branch name has been changed from master
to main
:
git branch -m master main
git fetch origin
git branch -u origin/main main
# source: @_sa_s | |
# Quick Xcode tip: if you want to launch a project with a particular Xcode version without running xcode-select, run | |
env DEVELOPER_DIR=/Applications/Xcode_11.3.app xed . |
// A re-usable alternative. | |
// reference: https://rambo.codes/posts/2020-02-20-mvc-with-sugar | |
public extension UIViewController { | |
func install(_ child: UIViewController) { | |
addChild(child) | |
child.view.translatesAutoresizingMaskIntoConstraints = false | |
view.addSubview(child.view) |
Based on Stack Overflow answer here.
os_log
messages.Compiled by Otto Schnurr from here in March 2017.
GitHub Pages is a static site hosting service.
From WWDC 2016: Unified Logging and Activity Tracing.
os_log
: Critical details for debugging issues.os_log_info
: Additional information to embed in error or fault reports.os_log_debug
: Optional, high-volume information that can be explicitly turned on during development.os_log_error
: Additional app information is bundled into the log message.os_log_fault
: Additional system information is bundled into the log message.#!/usr/bin/env python | |
from fileinput import input as data | |
from itertools import imap | |
def ifasta(lines): | |
name, dna = None, '' | |
for line in imap(str.rstrip, lines): | |
if line.startswith('>'): | |
if name: |
#!/usr/bin/env swift | |
import Foundation.NSString | |
private extension String { | |
var fastaID: String? { | |
guard hasPrefix(">") else { return nil } | |
return String(characters.dropFirst()) | |
} |
#!/usr/bin/xcrun swift -F . | |
// FileInput module from https://github.com/otto-schnurr/FileInput-swift | |
import FileInput | |
func complement(base: Character) -> Character { | |
switch base { | |
case "A": return "T" | |
case "T": return "A" | |
case "C": return "G" | |
case "G": return "C" |
#!/usr/bin/xcrun swift -F . | |
// FileInput module from https://github.com/otto-schnurr/FileInput-swift | |
import FileInput | |
func complement(base: Character) -> Character { | |
switch base { | |
case "T": return "U" | |
default: return base | |
} | |
} |