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
func until(cond func(), work func() bool) { | |
endSig := make(chan struct{}) | |
go func() { | |
for { | |
select { | |
case <-endSig: | |
return | |
default: | |
if !work() { | |
<-endSig |
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
function getUsage(command) | |
print("$ " .. command) | |
local subcommand = {} | |
local fd = assert(io.popen(command)) | |
for line in fd:lines() do | |
local m = string.match(line,"^ ([a-z][-a-z]+)") | |
if m then | |
subcommand[m] = {} | |
end | |
end |
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
#If WinActive("ahk_exe chrome.exe") | |
|| WinActive("ahk_exe msedge.exe") | |
|| WinActive("ahk_exe thunderbird.exe") | |
|| WinActive("ahk_exe firefox.exe") | |
|| WinActive("ahk_exe ONENOTE.EXE") | |
|| WinActive("ahk_class Framework::CFrame") | |
|| WinActive("ahk_exe onenoteim.exe") | |
|| WinActive("ahk_exe skype.exe") | |
|| WinActive("ahk_exe excel.exe") | |
|| WinActive("ahk_exe MSACCESS.EXE") |
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
nyagos.complete_for["make"] = function(args) | |
local target = {} | |
local fd=io.open("Makefile","r") | |
if fd then | |
for line in fd:lines() do | |
local m =string.match(line,'^([^:\t%s]+)%s*:') | |
if m then | |
target[1+#target] = m | |
end | |
end |
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 main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"os" | |
"path/filepath" |
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
nyagos.complete_for.go = function(args) | |
if #args == 2 then | |
return { | |
"build", "clean", "doc", "env", "fix", "fmt", "generate", | |
"get", "install", "list", "mod", "run", "test", "tool", "version", | |
"vet" | |
} | |
end | |
return nil | |
end |
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
nyagos.complete_for.git = function(args) | |
while #args > 2 and args[2]:sub(1,1) == "-" do | |
table.remove(args,2) | |
end | |
if #args == 2 then | |
return nyagos.fields([[ | |
add fsck-objects rebase | |
add--interactive gc receive-pack | |
am get-tar-commit-id reflog | |
annotate grep relink |
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
Exception 0xc0000005 0x1 0xc0004b0008 0x7721c080 | |
PC=0x7721c080 | |
syscall.Syscall6(0x772651f0, 0x4, 0x1f, 0xc0004831a0, 0x1, 0xc0004b0008, 0x0, 0x0, 0x0, 0x0, ...) | |
C:/go/src/runtime/syscall_windows.go:197 +0xfa | |
syscall.(*Proc).Call(0xc000362100, 0xc0004831c0, 0x4, 0x4, 0x20, 0x6ee280, 0x9dc501, 0xc0004831c0) | |
C:/go/src/syscall/dll_windows.go:177 +0x375 | |
syscall.(*LazyProc).Call(0xc00007b350, 0xc0004831c0, 0x4, 0x4, 0x40c5df, 0x20, 0x720c80, 0x9f7201) | |
C:/go/src/syscall/dll_windows.go:328 +0x66 | |
github.com/mattn/go-tty.readConsoleInput(0x1f, 0xc0004831a0, 0x0, 0x0) |
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
@setlocal | |
@set "PROMPT=%0> " | |
@call :"%1" | |
@endlocal | |
@exit /b | |
:"" | |
:"package" | |
for %%I in (386 amd64) do call :package1 windows %%I .exe | |
for %%I in (386 amd64) do call :package1 linux %%I |
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 main | |
import ( | |
"context" | |
"database/sql" | |
"fmt" | |
_ "github.com/denisenkom/go-mssqldb" | |
) |
NewerOlder