This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set tk_motif_binding_script { | |
event delete <<SelectAll>> | |
event add <<SelectAll>> <Control-Key-slash> | |
event add <<PrevChar>> <Control-Key-b> <Control-Lock-Key-B> | |
event add <<NextChar>> <Control-Key-f> <Control-Lock-Key-F> | |
event add <<PrevLine>> <Control-Key-p> <Control-Lock-Key-P> | |
event add <<NextLine>> <Control-Key-n> <Control-Lock-Key-N> | |
event add <<LineStart>> <Control-Key-a> <Control-Lock-Key-A> | |
event add <<LineEnd>> <Control-Key-e> <Control-Lock-Key-E> | |
event add <<SelectPrevChar>> <Control-Key-B> <Control-Lock-Key-b> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc is_computable_double {val} { | |
expr {[string is double -strict $val] && ![is_nan $val]} | |
} | |
proc is_nan {val} { | |
string match -nocase [string trimleft $val +-] "nan" | |
} | |
proc is_infinite {val} { | |
expr {$val == Inf || $val == -Inf} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc is_computable_double {val} { | |
expr {[string is double -strict $val] && ![is_nan $val]} | |
} | |
proc is_nan {val} { | |
string match -nocase [string trimleft $val +-] "nan" | |
} | |
proc is_infinite {val} { | |
expr {$val == Inf || $val == -Inf} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Esc:: | |
KeyWait, Esc, T0.1 | |
if ErrorLevel | |
send,{Esc} | |
else | |
send,!{vkC0} | |
keywait, Esc | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package require Tk | |
package require Img | |
package require twapi | |
# http://wiki.tcl.tk/15647 | |
# Copy the contents of the Windows clipboard into a photo image. | |
# Return the photo image identifier. | |
proc Clipboard2Img {} { | |
twapi::open_clipboard | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package require sqlite3 | |
sqlite3 mdb :memory: | |
set dt "2016-12-13T18:54:21.182556" | |
set unixepoch [mdb eval {SELECT strftime('%s',$dt,'UTC')}] | |
puts $unixepoch | |
#=> 1481622861 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package require math::decimal | |
math::decimal::setVariable extended 0 | |
proc tcl::mathfunc::roundto {value sigfig dp} { | |
math::decimal::setVariable precision $sigfig | |
set d_val [math::decimal::fromstr $value] | |
set d_rou [math::decimal::round_half_up $d_val 100] | |
set d_rou [math::decimal::round_floor $d_rou $dp] | |
math::decimal::tostr $d_rou |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package require Garuda | |
set script { | |
object load -import System | |
object load -import UIAutomationClient | |
object load -import UIAutomationTypes | |
object load -import UIAutomationProvider | |
object load -import UIAutomationClientsideProviders | |
set process [object invoke Process Start "calc"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package require twapi | |
if {![namespace exists twapi_timer]} { | |
namespace eval twapi_timer { | |
variable ids | |
array set ids {} | |
} | |
} | |
proc twapi_timer::_timer_handler {script hevent sig} { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chcp 437 | |
vssadmin list ShadowStorage /On=C:|findstr /c:"Maximum Shadow Copy Storage space: UNBOUNDED (100%)" | |
IF ERRORLEVEL 0 (vssadmin Resize ShadowStorage /For=C: /On=C: /MaxSize=10%) |