Skip to content

Instantly share code, notes, and snippets.

View tsaiid's full-sized avatar

I-Ta Tsai tsaiid

View GitHub Profile
@tsaiid
tsaiid / imagemagick-engine.diff
Created June 20, 2013 13:11
in safe_mode, exec() will force to use escapeshellcmd(), which will cause problem if pre-added quote.
@@ -472,7 +472,7 @@ function ime_im_cli_check_executable($fullpath) {
if (!is_executable($fullpath))
return false;
- @exec('"' . $fullpath . '" --version', $output);
+ @exec($fullpath . ' --version', $output);
return count($output) > 0;
}
@@ -547,7 +547,7 @@ function ime_im_cli_resize( $old_file, $new_file, $width, $height, $crop, $resiz
@tsaiid
tsaiid / sublime-text-preference
Last active January 1, 2016 23:09
Sublime Text Preference
{
// Material Theme
"theme": "Material-Theme.sublime-theme",
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"overlay_scroll_bars": "enabled",
"line_padding_top": 3,
"line_padding_bottom": 3,
//"font_options": [ "gray_antialias" ], // On retina Mac
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
@tsaiid
tsaiid / .zshrc
Created January 2, 2014 13:44
My .zshrc
# Customize to your needs...
DEFAULT_USER="tsaiid"
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
PATH=/usr/local/bin:$PATH # Homebrew
# For ssh-agent
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
@tsaiid
tsaiid / get-previous-report.ahk
Last active January 2, 2016 11:09
get-previous-report.ahk for SmartWonder
; HotKey
;; for SmartWonder
#IfWinActive, tedpc-
IEGet(Name="") ;Retrieve pointer to existing IE window/tab
{
IfEqual, Name,, WinGetTitle, Name, ahk_class IEFrame
Name := ( Name="New Tab - Windows Internet Explorer" ) ? "about:Tabs"
: RegExReplace( Name, " - (Windows|Microsoft) Internet Explorer" )
For wb in ComObjCreate( "Shell.Application" ).Windows
@tsaiid
tsaiid / get-previous-report-by-click-all.ahk
Last active January 2, 2016 11:09
Previous AHK script for SmartWonder by clicking inprecisely.
MouseGetPos, xpos,ypos
Click 700, 180 ; 歷史報告
Click 270, 325 ; 開影像
Click 1080, 741 ; 複製報告
Click 1080, 759 ; 複製報告
Click 1080, 777 ; 複製報告
Click 1080, 795 ; 複製報告
Click 1080, 813 ; 複製報告
Click 1080, 831 ; 複製報告
Click 300, 180 ; 回報告區
MouseGetPos, xpos,ypos
Click 700, 180 ; 歷史報告
Click 270, 325 ; 開影像
Click 1080, 759 ; 複製報告
Click 300, 180 ; 回報告區
MouseMove, %xpos%, %ypos%
diff --git a/chrome/content/pcman.xul b/chrome/content/pcman.xul
index 3ff4c9b..a6a5d18 100755
--- a/chrome/content/pcman.xul
+++ b/chrome/content/pcman.xul
@@ -50,11 +50,10 @@
}
function resize(){
- var win=document.getElementById('topwin');
- var canvas=document.getElementById("canvas");
; SmartWonder Extension
; Renumbering Selected Lines
; Group Control For SmartWonder
GroupAdd, SmartWonder, VGHKS-
GroupAdd, SmartWonder, vghks-
GroupAdd, SmartWonder, tedpc-
; WBGet()
; Access an IE object by WinTitle and Internet Explorer_Server Number
import xml.etree.ElementTree as ET
import urllib2
import re
import os
# remove current images
working_dir = os.path.dirname(os.path.realpath(__file__))
for root, dirs, files in os.walk(working_dir, topdown=False):
for file in files: