(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| cd $HOME | |
| FileName='go1.12.5.linux-armv6l.tar.gz' | |
| wget https://dl.google.com/go/$FileName | |
| sudo tar -C /usr/local -xvf $FileName | |
| cat >> ~/.bashrc << 'EOF' | |
| export GOPATH=$HOME/go | |
| export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin | |
| EOF | |
| source ~/.bashrc |
| extension UIImage { | |
| // UIImage extension that creates a UIImage from a UIView | |
| convenience init (view:UIView) { | |
| UIGraphicsBeginImageContext(view.frame.size) | |
| view.layer.render(in: UIGraphicsGetCurrentContext()!) | |
| let image = UIGraphicsGetImageFromCurrentImageContext() | |
| UIGraphicsEndImageContext() | |
| self.init(cgImage: image!.cgImage!) | |
| } |
| import Foundation | |
| extension CFStringEncodings { | |
| var encoding: String.Encoding { | |
| return String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(CFStringEncoding(self.rawValue))) | |
| } | |
| } | |
| public extension String.Encoding { | |
| public static let big5 = CFStringEncodings.big5.encoding |
| import Foundation | |
| import CoreLocation | |
| extension CLRegionState : CustomStringConvertible { | |
| public var description: String { | |
| switch self { | |
| case .unknown: | |
| return "unknown" | |
| case .inside: | |
| return "inside" |
| #!/bin/sh | |
| docker rm -f $(docker ps -qa) | |
| docker volume rm $(docker volume ls -q) | |
| cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke" | |
| for dir in $cleanupdirs; do | |
| echo "Removing $dir" | |
| rm -rf $dir | |
| done |
| <!-- | |
| Tutorial code for: http://www.binpress.com/tutorial/generating-nice-movie-previews-with-ffmpeg/138 | |
| --> | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title></title> | |
| </head> | |
| <body> | |
| <a href="https://www.youtube.com/watch?v=v1uyQZNg2vE" target="_blank" class="video-preview" data-frames="100" data-source="http://i.imgur.com/BX0pV4J.jpg"></a> |
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "chrome", | |
| "request": "launch", | |
| "name": "Launch Chrome against localhost", | |
| "url": "http://localhost:3000", | |
| "sourceMaps": true, | |
| "webRoot": "${workspaceRoot}/dist", |
| const fibonacci = { | |
| [Symbol.iterator]: function* () { | |
| yield 0; | |
| yield 1; | |
| let [pre, cur] = [0, 1]; | |
| while (true) { | |
| [pre, cur] = [cur, pre + cur] | |
| yield cur; | |
| } | |
| } |
We will compare ASP.NET and Node.js for backend programming.
Source codes from examples.
This document was published on 21.09.2015 for a freelance employer. Some changes since then (14.02.2016):
async/await. yield and await are used almost in the same way, so I see no point to rewrite the examples.