Skip to content

Instantly share code, notes, and snippets.

View kjk's full-sized avatar

Krzysztof Kowalczyk kjk

View GitHub Profile
#include <iostream>
template<unsigned int n>
struct factorial
{
enum
{
value = n * factorial<n - 1>::value
};
};
@kjk
kjk / create_zip_file.go
Last active June 29, 2020 08:45
Create ZIP file in Go (made with https://codeeval.dev)
package main
import (
"archive/zip"
"fmt"
"io"
"log"
"os"
"path/filepath"
)
@kjk
kjk / check default program windows.txt
Created April 9, 2020 03:02
checking / setting default programs on windows (made with https://codeeval.dev)
Source code examples:
* https://grep.app/search?q=IApplicationAssociationRegistration&filter[lang][0]=C%2B%2B
* https://github.com/QupZilla/qupzilla/blob/master/src/lib/other/registerqappassociation.cpp
* https://github.com/mpc-hc/mpc-hc/blob/master/src/mpc-hc/FileAssoc.cpp
* https://github.com/syndicodefront/infekt/blob/master/src/win32/default_app_win7.cpp
* https://github.com/syndicodefront/infekt/blob/master/src/win32/default_app_win8.cpp
In gecko-dev source code:
* Telemetry.cpp
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"bytes"
"fmt"
"io"
"log"
"os"
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"fmt"
"os/exec"
)
func checkExeExists(exe string) {
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"fmt"
"log"
"os"
"os/exec"
)
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"bytes"
"compress/bzip2"
"fmt"
"io"
"io/ioutil"
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"bytes"
"fmt"
"io"
"log"
"os"
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"bytes"
"fmt"
"io"
"log"
"os"
package main
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html
import (
"fmt"
"io"
"log"
"os"
"os/exec"