Skip to content

Instantly share code, notes, and snippets.

@tanyuan
tanyuan / unity-arduino-serial.md
Last active June 13, 2023 17:18
Unity writes Arduino via serial port

Unity Writes Arduino via Serial Port

Tap 1 0 keys in Unity will make Arduino LED light on/off.

Arduino

const int ledPin = 13;
int ledState = 0;
@tanyuan
tanyuan / unityReadWriteFile.cs
Created January 7, 2017 19:40
Unity read & write text files.
using System.IO;
string path = "Assets/file.txt";
// Write to file
File.AppendAllText(path, System.String.Format("{0} {1} {3}\n", var1, var2, var3));
// Read from file
StreamReader sr = new StreamReader(path);
for (int i = 0; !sr.EndOfStream; i++) {
@tanyuan
tanyuan / samba-elementary-os.md
Last active May 15, 2023 18:24
Elementary OS (Ubuntu) Samba Server Setup

Setup up Samba file server on Elementary OS (Ubuntu)

So you can access files from other computers (Linux, Mac, Windows) on the same network!

  1. Install Samba:
sudo apt install samba samba-common
@tanyuan
tanyuan / fcitx-chewing.png
Last active February 26, 2023 14:20
Ubuntu: fcitx + chewing 新酷音輸入法
fcitx-chewing.png
{
"packages": [{
"name": "Seeeduino",
"maintainer": "Seeed Studio",
"websiteURL": "https://www.seeedstudio.com/",
"email": "techsupport@seeed.cc",
"help": {
"online": "https://wiki.seeedstudio.com/"
},
"platforms": [{
@tanyuan
tanyuan / mac-apps.md
Created April 23, 2019 06:43
Mac Apps

Mac Apps

Free Apps

  • iTerm2 - The best terminal. Support Vim better. See this gist for tips and tricks.
  • CotEditor - A simple and neat plain text editor.
  • Skim - A PDF reader designed for annotating academic papers.
  • IINA - A more powerful video player.
  • The Unarchiver - Decompress RAR, 7-Zip, Tar, etc.
  • DaisyDisk (Freemium) - Examine disk usage with a pie chart.
@tanyuan
tanyuan / README.md
Created October 10, 2016 04:56
Fix Apple keyboard Caps Lock delay.

Fix Apple keyboard Caps Lock delay.

Useful when remapped to another key.

Compile the code:

    gcc apple-kb-caps.c -o apple-kb-caps

Move the executable apple-kb-caps and script run-apple-kb-caps to ~/bin/.

@tanyuan
tanyuan / ranger.md
Created February 29, 2016 04:02
Notes on ranger the miller columns console file manager.

Ranger File Manager

Use Python 3. q to quit.

Shortcuts

File manipulation

  • Space: Select file or directory like Ctrl.
  • v/V: Select continuously like Shift.
  • yy: Copy files.
@tanyuan
tanyuan / samba.md
Last active February 25, 2022 14:55
Access Arch Linux folders from Mac using samba

Access Arch Linux folders from Mac using samba

Tested with Arch Linux and macOS Sierra

First make sure that the two machines can see each other.

On Arch, find out IP of Arch Linux machine by:

ip addr
@tanyuan
tanyuan / atom-latex.md
Last active May 15, 2021 17:41
Edit LaTeX and view PDF in Atom!

Edit LaTeX and view PDF in Atom (Pretty easy!)

  1. Download and install Atom.
  2. Install LaTeX for your OS.
  1. Open Atom, install packages: Go to Preferences... > Left pane Install > Search and install packages:
  • pdf-view: view PDF in Atom.