Skip to content

Instantly share code, notes, and snippets.

@tanyuan
tanyuan / host_otterwiki_on_pythonanywhere.md
Last active July 13, 2025 17:06
How to host Otterwiki on Python Anywhere

How to host Otterwiki on Python Anywhere

This is step-by-step to host Otterwiki on Python Anywhere without using docker. This way you have the flexibility to edit the code (CSS, etc) as you like.

Replace all username with your own username.

1. Open a bash console, git clone, and make

Basically following Otterwiki Development:

{
"packages": [{
"name": "Seeeduino",
"maintainer": "Seeed Studio",
"websiteURL": "https://www.seeedstudio.com/",
"email": "[email protected]",
"help": {
"online": "https://wiki.seeedstudio.com/"
},
"platforms": [{
@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.
@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
using UnityEngine;
using System.Collections;
public class RecordROI : MonoBehaviour {
public GameObject highlight;
public string path;
private Vector3 mousePos;
private Vector3 spherePos;
@tanyuan
tanyuan / create-day-one-entry.sh
Created January 11, 2018 20:46
📘 Create Day One entry using simple graphical interface (Zenity) on Linux and import to Day One on Mac.
#!/bin/bash
noteDir="$1"
if [ "$noteDir" != "" ]
then
date=$(date '+%Y-%m-%d %H:%M:%S')
# Create a text box
zNewData=$(zenity --text-info --editable --width 650 --height 400)
@tanyuan
tanyuan / iterm2.md
Last active January 18, 2025 02:59
📺 iTerm2 tips & tricks

iTerm2 (The awesome terminal for Mac)

Look and feel

  • Window theme: Preferences > Appearance Tab > Theme > Light/Dark
  • Show folder icon on window title: Preferences > Appearance Tab > Window: Show proxy icon in window title bar
  • Background transparancy and blur: Preferences > Profiles Tab > Window Tab > Transparency (a third) & Blur (Checked, full)
  • Color theme: Preferences > Profiles Tab > Colors Tab > Color Presets...

Window and tab title

@tanyuan
tanyuan / python_args.py
Created January 7, 2018 18:36
Python args template: read shell arguments
import argparse
if __name__ == '__main__' :
parser = argparse.ArgumentParser(description='Program description')
parser.add_argument('input', help='Input file')
parser.add_argument('-o', '--option', type=int, help='Integer option')
args = parser.parse_args()
@tanyuan
tanyuan / makefile_simple
Created January 7, 2018 18:35
Makefile template (simple)
CXX=g++
CFLAGS=-g -Wall
INCLUDE=
LINK=
all: program
%: %.cpp
$(CXX) $(CFLAGS) $(INCLUDE) $< -o $@ $(LINK)
@tanyuan
tanyuan / makefile
Created January 7, 2018 18:34
Makefile template
CC = g++
CFLAGS = -c
C11 = -std=c++11
DBGFLAGS = -g
# include OpenGL/freeglut
INC = -lGL -lGLU -lglut
all:3dmm_hw1
@echo -n ""