Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

yan palytoxin

🎯
Focusing
Block or report user

Report or block palytoxin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View vscode-setting.json
{
"cSpell.language": "en",
"window.zoomLevel": 0,
"breadcrumbs.enabled": true,
"editor.tabSize": 2,
"editor.fontFamily": "Monaco, 'Courier New', monospace",
"editor.minimap.enabled": true,
"editor.trimAutoWhitespace": true,
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 120,
View gist:d2e0de0f783a17959ad4ec19224cc016
version: '2'
services:
mariadb:
image: 'bitnami/mariadb:10.3'
user: root
environment:
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '3306:3306'
volumes:
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View gist:13c8c55192df4e36cb46
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
User=nobody
Group=nobody
ExecStart=/usr/bin/ssserver --pid-file /var/run/shadowsocks/redir.pid -c /etc/shadowsocks.json
Restart=on-failure
ExecReload=/bin/kill -HUP $MAINPID
View happycasts_sync.sh
#!/bin/bash
sync_dryrun()
{
echo
echo -e "\033[1m ...dryrun...\033[0m"
rsync -vr --delete ~/happycasts/episodes/ peter@linode:~/media/assets/episodes/ --dry-run
echo -e "\033[1m ...dryrun...\033[0m"
echo
}
@palytoxin
palytoxin / em_fiber.rb
Last active Jan 17, 2019 — forked from zw963/em_fiber.rb
Fiber using
View em_fiber.rb
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# 有关 Fiber 的解释: (按照数据流的方向分为两部分)
# 在 `主线程' 中使用 resume 方法来启动(或继续执行)一个 `纤程'.
# 1. 第一次调用 fiber.resume, 会启动一个纤程,
# 如果 resume 调用时提供了实参, 会作为代码块形参传入代码块.
# 2. 如果非第一次调用 fiber.resume, 即, `恢复' 一个纤程, 会做两件事:
# - 从上次离开纤程的那个位置(调用 Fiber.yield 离开纤程的那个位置), 恢复纤程的执行.
You can’t perform that action at this time.