Skip to content

Instantly share code, notes, and snippets.

@windsting
windsting / work-with-multiple-github-accounts.md
Created March 29, 2023 22:32 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@windsting
windsting / RPi-Serial.md
Created September 24, 2022 18:44
Cannot open /dev/ttyUSB0: Permission denied

While accessing serial port on Raspberry Pi 4 with Manjaro(ARM Mate) installed like:

stcgal -P auto

got an error:

Serial port error: [Errno 13] could not open port /dev/tty1: [Errno 13] Permission denied: '/dev/ttyUSB0'
@windsting
windsting / alt-f_and_alt-b_on_mac.md
Last active August 31, 2024 16:37
Use alt-f and alt-b to jump forward and backward in command line on macOS

Use alt-f and alt-b to jump forward and backward in command line on macOS

On macOS, the default behavior of key combination alt-f and alt-b are insert characters ƒ and , which is conflict with the navigation.

To cope with this, you need to change settings of terminal emulator application.

Terminal - the default one on macOS

The operation below is tested on Version 2.10 (433).

@windsting
windsting / app.py
Created November 26, 2019 05:55
Discuz! forum onliner
#!/usr/bin/env python
#coding=utf-8
from config import *
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from collections import namedtuple
import os
import sys
import time
@windsting
windsting / eggs.py
Created November 19, 2019 08:57
7个鸡蛋,放进3个不同的碗,允许有空碗,有多少种放法?
#!/usr/bin/env python
#coding=utf-8
# 7个鸡蛋,放进3个不同的碗,允许有空碗,有多少种放法?
# use function `place` to get answer
# and `place_non` for **avoid empty bowl**
def gen_counts(prev, cur):
str = f"{cur}" if prev == "" else f"{prev},{cur}"
return str
@windsting
windsting / ssr_and_v2ray.md
Last active September 22, 2019 19:37
Shadowsocksr & V2ray

Anti-GFW

All these command tested on Ubuntu 18.04.

BBR

# add config
sudo echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
sudo echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
@windsting
windsting / phonetic-zh-tw.md
Created February 12, 2019 03:17
汉语注音与汉语拼音对照表

汉语注音与汉语拼音对照表

此表摘自维基百科的页面 注音符號

部分“字源”中的字形图片缺失,可以到上面的页面进行查阅。

声母

注音 字源 拼音 例子
@windsting
windsting / github-pandoc.css
Created November 13, 2018 06:40 — forked from dashed/github-pandoc.css
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@windsting
windsting / starting-postgresql-in-windows-without-install.md
Created September 20, 2018 10:50
Starting Postgresql in Windows without Install

Starting Postgresql in Windows without Install

Problem

This is a question that comes up quite often by windows users, so thought we would share how we normally do it. The question is

Can you run a PostgreSQL server on your windows desktop/server box without having to install anything?

The answer is

@windsting
windsting / add_utf8_BOM.md
Created September 14, 2018 06:18
为 UTF-8 编码的文本文件添加BOM

为 UTF-8 编码的文本文件添加 BOM

应用场景

  • 在 macOS 和 Windows 下同步 Cocos2D 项目

    Cocos2D 项目,在 macOS 下用 Xcode 编辑后,UTF-8 编码文件保存时不带 BOM,导致在 Windows 下用 Visual Studio 编译期报错,给这些文件添加 BOM 后,可以解决这些编译期错误,并且不会导致 Xcode 中编译有问题。

系统需求