Skip to content

Instantly share code, notes, and snippets.

@tanyuan
tanyuan / screenshot-area
Created September 24, 2016 14:13
Ubuntu screenshot without dialog window. Put these in ~/bin/
#!/bin/bash
gnome-screenshot -a -f "$HOME/Pictures/Screenshot from $(date '+%F %T').png"
@tanyuan
tanyuan / fcitx-chewing.png
Last active August 19, 2024 22:42
Ubuntu: fcitx + chewing 新酷音輸入法
fcitx-chewing.png
@tanyuan
tanyuan / 69-language-selector-zh-tw.conf
Last active September 24, 2016 14:45
Ubuntu: 英文介面 + 中文台灣字型
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Set fonts selection order for Chinese users -->
<match target="pattern">
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
@tanyuan
tanyuan / draw-box-plot.r
Last active March 10, 2017 13:19
Draw Box Plot for Likert Scale in R
# Set margins for the plot (LEFT, RIGHT, TOP, BOTTOM)
par(mar=c(3,10,3,1))
# Draw box plot (axis from 1 - 7)
boxplot(data, horizontal = TRUE, las =1, col = "#dddddd", ylim=c(1,7))
# Plot title
title(main="Likert Box Plot")
@tanyuan
tanyuan / InsideVisible.shader
Last active August 28, 2016 12:36
Play 360 Videos in Unity
// Based on Unlit shader, but culls the front faces instead of the back
Shader "InsideVisible" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
Cull front // ADDED BY BERNIE, TO FLIP THE SURFACES
@tanyuan
tanyuan / win-key.md
Created June 12, 2016 08:14
Windows Key as Task View

Make Windows Key be Task View on Windows 10

Win is not useful for opening the Start Menu. How about making it open Task View on Windows 10?

Task View can be open via Win+Tab by default, but now we just want it to be Win!

  1. Install AutoHotKey.
  2. Put this line in AutoHotKey.ahk in Documents:

LWin:: #Tab

@tanyuan
tanyuan / macbook-air.md
Created May 16, 2016 12:30
Make things bigger on MacBook Air 11'

Make Things Bigger On MacBook Air 11'

Things on MacBook Air is small and hard to read.

Make everything bigger

You can make MacBook Air believe it has a retina screen and thus it renders everything larger.

  1. Run this command:
@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 / gnome-pie.md
Created April 25, 2016 15:41
Gnome Pie notes

Gnome Pie

If you use GNOME 3 and File Manager bookmarks are not recognized, this is because Gnome Pie reads file at ~/.gtk-bookmarks, where is not GNOME 3 stores bookmarks.

Simply make a symbolic link solves the problem:

ln -s ~/.config/gtk-3.0/bookmarks ~/.gtk-bookmarks
@tanyuan
tanyuan / trash.sh
Created April 23, 2016 05:40
Don't rm, just trash!
# Put this in ~/.bashrc
# Move files to the default trash directory on Mac OS X, or you simply create one
trash() {
mv $1 ~/.Trash/
}