Skip to content

Instantly share code, notes, and snippets.

View kjk's full-sized avatar

Krzysztof Kowalczyk kjk

View GitHub Profile
package main
import (
"flag"
"fmt"
"log"
"os"
"runtime/debug"
"runtime/pprof"
"strconv"
package main
import (
"flag"
"fmt"
"log"
"os"
"runtime/pprof"
"strconv"
"sync"
const puppeteer = require("puppeteer");
let waitTime = 5 * 1000;
async function testAjax() {
const url = "https://www.notion.so/Test-page-all-c969c9455d7c4dd79c7f860f3ace6429"
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setRequestInterception(true);
// those we don't want to log because they are not important
@kjk
kjk / reflect_slice.go
Created August 31, 2018 04:05
How to create a reflect slice
package main
import (
"fmt"
"log"
"reflect"
)
type S struct {
N int
@kjk
kjk / cmd-git-log.go
Created March 21, 2019 00:40
Compare output of 2 git log --format=oneline commands to see commits unique in each branch
package main
import (
"bytes"
"fmt"
"io/ioutil"
"strings"
)
/*
@kjk
kjk / fakemenu.c
Last active September 24, 2021 13:19
how to implement menu-like pop-up the right way in win32
/*****************************************************************************
* Sample program to demonstrate how a program can display a
* popup window which does not deactivate its parent. This
* can be used for things like a magnifying glass window or
* a pseudo-menu.
*****************************************************************************/
#define STRICT
#include <windows.h>
#define COMPILE_MULTIMON_STUBS
@kjk
kjk / keybase.md
Created July 2, 2019 22:34
keybase

Keybase proof

I hereby claim:

  • I am kjk on github.
  • I am kjksf (https://keybase.io/kjksf) on keybase.
  • I have a public key ASAdCRkKmAhWMJJsU_q76BM_JyYK5-MZMrwrr6qTOk3WEwo

To claim this, I am signing this object:

@kjk
kjk / chromedp_bug.go
Created July 24, 2019 20:17
chromedp bug
package main
import (
"context"
"fmt"
"net/url"
"time"
"github.com/chromedp/cdproto/cdp"
"github.com/chromedp/chromedp"
@kjk
kjk / main.go
Last active October 30, 2019 11:58
test goldmark markdown
package main
import (
"bytes"
"fmt"
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/extension"
)
func main() {
@kjk
kjk / sumatranotes.txt
Last active October 31, 2019 21:31
notes from sumatra mupdf upgrade
fz_add_text => fz_add_text_span
removed symbols from libmupdf.def:
fz_analyze_text
fz_keep_transfer_function
fz_drop_transfer_function
fz_apply_transfer_function
fz_buffer_cat
fz_buffer_printf
fz_buffer_vprintf