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
var users []database.User | |
db.Find(&users) |
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
FROM scratch | |
ARG TARGETOS | |
ARG TARGETARCH | |
ADD /${TARGETOS}/${TARGETARCH} / | |
ENTRYPOINT ["/system_service"] |
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
name=${PWD##*/} | |
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o linux/amd64/"$name" | |
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o linux/arm64/"$name" | |
upx --best --lzma linux/amd64/"$name" | |
upx --best --lzma linux/arm64/"$name" | |
docker rmi -f petrjahoda/"$name":latest | |
docker buildx build -t petrjahoda/"$name":latest --platform=linux/arm64,linux/amd64 . --push |
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
global computerIsInUse, resetTime | |
on run | |
set computerIsInUse to true | |
set resetTime to (do shell script "date +%s") as integer | |
end run | |
on idle | |
set idleTime to (do shell script "ioreg -c IOHIDSystem | awk '/HIDIdleTime/ {print $NF; exit}'") as integer | |
if idleTime is greater than 7.4E+10 then |
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 ( | |
"bufio" | |
"fmt" | |
"net" | |
"strconv" | |
"sync" | |
"time" | |
) |
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 ( | |
"bufio" | |
"fmt" | |
"net" | |
"strconv" | |
"time" | |
) |
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" | |
"fmt" | |
"github.com/gobwas/ws" | |
"github.com/gobwas/ws/wsutil" | |
"math/rand" | |
"os" | |
"strconv" |
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 ( | |
"fmt" | |
"github.com/gobwas/ws" | |
"github.com/gobwas/ws/wsutil" | |
"math/rand" | |
"net/http" | |
"strconv" | |
) |
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 "fmt" | |
type Car struct { | |
name string | |
} | |
type Truck struct { | |
name string |
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 "fmt" | |
type Car struct { | |
name string | |
} | |
type Truck struct { | |
name string |
NewerOlder