Skip to content

Instantly share code, notes, and snippets.

View NaniteFactory's full-sized avatar
๐Ÿ˜Š
Hi

NaniteFactory

๐Ÿ˜Š
Hi
View GitHub Profile
@NaniteFactory
NaniteFactory / manifest.json
Created December 19, 2018 09:46
chrome theme
{
"manifest_version": 2,
"name": "Orange frame with distinguishable gray tabs",
"version": "0.1",
"theme": {
"colors": {
"background_tab": [ 210, 213, 217 ],
"background_tab_inactive": [ 213, 215, 220 ],
"background_tab_incognito": [ 38, 39, 42 ],
"background_tab_incognito_inactive": [ 53, 56, 58 ],
@NaniteFactory
NaniteFactory / test_write_to_memory.go
Last active May 31, 2022 03:10
golang runtime bytes patch in windows
package main
import (
"unsafe"
"github.com/nanitefactory/memory"
"github.com/nanitefactory/outputdbg"
)
// #include <windows.h>
@NaniteFactory
NaniteFactory / sum.go
Created January 25, 2019 17:19
a Golang function that takes multiple numbers as its parameter then returns the sum of those
sum := func(nums ...float64) float64 {
ret := 0.0
for _, num := range nums {
ret += num
}
return ret
}
@NaniteFactory
NaniteFactory / explode_multiple_returns.go
Last active January 31, 2019 07:50
Exploding multiple returns to pass to a call to a variadic function.
package main
func multipleRets() (int, int, int, int) {
return 11, 22, 33, 44
}
func main() {
s1 := append([]int{}, []int{11, 22, 33, 44}...) // This is fine.
s2 := append([]int{}, multipleRets()) // But this one errors.
s3 := append([]int{}, toSlice(multipleRets())...) // Getting through it.
@NaniteFactory
NaniteFactory / ComponentList.SC2Components
Last active October 5, 2019 10:11
12 keys of MPQ ComponentList.SC2Components
<?xml version="1.0" encoding="us-ascii"?>
<Components>
<DataComponent Type="gada">GameData</DataComponent>
<DataComponent Type="text" Locale="enUS">GameText</DataComponent>
<DataComponent Type="info">DocumentInfo</DataComponent>
<DataComponent Type="mapi">MapInfo</DataComponent>
<DataComponent Type="trig">Triggers</DataComponent>
<DataComponent Type="terr">t3Terrain.xml</DataComponent>
<DataComponent Type="plob">Objects</DataComponent>
<DataComponent Type="attr">Attributes</DataComponent>
@NaniteFactory
NaniteFactory / setcookie.go
Created October 21, 2019 06:30
chromedp set-cookie example
package main
import (
"context"
"fmt"
"log"
"time"
"github.com/chromedp/cdproto/cdp"
"github.com/chromedp/cdproto/network"
@NaniteFactory
NaniteFactory / fullscreenshot.go
Created October 21, 2019 06:55
chromedp screenshot example
package main
import (
"context"
"io/ioutil"
"log"
"math"
"time"
"github.com/chromedp/cdproto/emulation"

chromedp ๊ตฌ์„ฑ์š”์†Œ ์ •๋ฆฌ ์š”์•ฝ

2019๋…„ 11์›” 30์ผ

chromedp ํŒจํ‚ค์ง€์˜ ์ „์ฒด๋ฅผ ํŒŒ์•…ํ•˜๊ธฐ ์œ„ํ•ด ํ•ต์‹ฌ ํƒ€์ž…์„ ์ค‘์‹ฌ์œผ๋กœ ์„ค๋ช… ์ •๋ฆฌ

ํ๋ฆ„์„ ํฐ ์ค„๊ธฐ์—์„œ ์‹œ์ž‘ํ•˜์—ฌ ์ž‘์€ ์ค„๊ธฐ์™€ ๋ง๋‹จ์— ์ด๋ฅด๋Š” ์ˆœ์„œ๋กœ ๊ตฌ์„ฑํ•จ


@NaniteFactory
NaniteFactory / go-sqlite3.go
Created November 30, 2019 17:38
go sqlite tutorial example
package main
import (
"database/sql"
"log"
_ "github.com/mattn/go-sqlite3"
)
func main() {
@NaniteFactory
NaniteFactory / nested_defer.go
Created December 6, 2019 08:24
Nested function calls in a defer statement.
package main
import "log"
func foo1(n int) int {
log.Println("foo1", n)
return n
}
func foo2(n int) int {
log.Println("foo2", n)