Skip to content

Instantly share code, notes, and snippets.

@tanyuan
tanyuan / sketchup.md
Last active April 20, 2016 16:18
SketchUp 建模3D列印技巧

SketchUp 建模3D列印

下載免費的 SketchUp Make 即可。注意剛開始選擇 Template 的時候選擇給3D列印,單位是 mm 的,才夠精準。

原則:精準,一次完成

  • 剛開始在紙上畫出所有精確的長度(用游標卡尺),建模時用精準的數字,因為之後不能改。
  • 移動時多利用參考線(量尺),畫出很多現之後才能精準的移動。
  • 從一個原始物件慢慢「推出」立體,而不要用許多物件組成一個物體。
@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/
}
@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 / 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 / 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 / processing-arduino-serial.md
Created April 13, 2016 00:58
Robust serial transmitting between Processing and Arduino

Send a big number from Processing to Arduino through serial

We would like to send a big number (0-1023) from Processing to Arduino (which can only read 0-255 at a time).

In Processing:

import processing.serial.*;

Serial arduino;
@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 / 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 / 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 / chromium-local-file
Created October 10, 2016 05:13
Open a Chromium session allowing local file access.
#!/bin/bash
chromium-browser --user-data-dir='/tmp' --allow-file-access-from-files $1 &