bash:
$ tmux set-window-option main-pane-width 20; tmux select-layout main-vertical
tmuxp:
session_name: DB
package main | |
import "log" | |
// types. | |
type Fn func(id string, name string) error | |
// actions. | |
func Insert(id string, name string) error { | |
log.Println("Insert ID:", id, " Name:", name) |
bash:
$ tmux set-window-option main-pane-width 20; tmux select-layout main-vertical
tmuxp:
session_name: DB
package main | |
import ( | |
"fmt" | |
"net/http" | |
"github.com/gocolly/colly" | |
) | |
type MyCollector struct { |
""" | |
Single Responsibility Principle | |
“…You had one job” — Loki to Skurge in Thor: Ragnarok | |
A class should have only one job. | |
If a class has more than one responsibility, it becomes coupled. | |
A change to one responsibility results to modification of the other responsibility. | |
""" | |
class Animal: | |
def __init__(self, name: str): |
$ qemu-img create arch.img 30G
$ qemu-system-x86_64 -boot d -cdrom archlinux-x86_64.iso -m 4096 -hda arch.img -net nic -net user
use std::time::Duration; | |
async fn action() { | |
loop { | |
print!("Hello!"); | |
tokio::time::sleep(Duration::from_millis(1)).await; | |
} | |
} | |
#!/bin/sh | |
env WINIT_UNIX_BACKEND=x11 alacritty msg create-window 2>/dev/null || alacritty |
package main | |
import ( | |
"encoding/xml" | |
"fmt" | |
) | |
const data = `<?xml version='1.0' encoding='UTF-8'?> | |
<response-data><data target="server1"></data></response-data> | |
` |
cd
wget https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz
tar -zxvf go1.6.2.linux-amd64.tar.gz
sudo mv go /usr/local/
export GOROOT=/usr/local/go
mkdir -p ~/gitwork/go/src
mkdir ~/gitwork/go/bin