Skip to content

Instantly share code, notes, and snippets.

@tanyuan
tanyuan / mac-tips.md
Last active April 23, 2019 06:42
Mac Tips

Mac Tips

🗂 Tabs

System Preferences:

  • Dock > Prefer tabs when opening documents > Always.
  • Tabs are built in many Apple apps.
    • See an overview of tabs by View > Show All Tabs.
  • Merge tabs across windows by Window > Merge All Windows.
@tanyuan
tanyuan / userChrome.css
Last active November 19, 2018 10:04
🦊 Firefox macOS: Tabs on Bottom & Tab Close Button on Left
/* Firefox userChrome.css for Mac
1) Tabs on Bottom
2) Tab Close Button on Left
*/
/* Tabs on Bottom */
/* -------------------------------- */
#TabsToolbar {
-moz-box-ordinal-group: 2;
}
@tanyuan
tanyuan / README.md
Last active February 15, 2018 05:33
Control MakerBot movement using Python
@tanyuan
tanyuan / windows-apps.md
Last active February 3, 2018 10:37
Windows applications
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 / 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 ""
@tanyuan
tanyuan / unity-zip.sh
Created December 19, 2017 16:35
Zip only needed files for Unity projects.
zip -r project.zip Assets/ ProjectSettings/