Skip to content

Instantly share code, notes, and snippets.

@newpolaris
newpolaris / glfw.txt
Last active March 2, 2021 03:38
CMakeLists.txt
// ref: https://www.glfw.org/docs/3.3.1/build_guide.html
find_package(glfw3 3.3 REQUIRED)
target_link_libraries(myapp glfw)
find_package(OpenGL REQUIRED)
target_link_libraries(myapp OpenGL::GL)
@newpolaris
newpolaris / klbib.py
Last active February 26, 2024 07:11
replace great suspender url to normal one in bookmark (klbibkeccnjlkjkiokjodocebajanakg)
#!/usr/bin/python
## STEP:
# (requires OSX ?)
# pip install pyobjc
# python kibib.py
# Hide python rocket ship from popping up in Dock when run.
import AppKit
@newpolaris
newpolaris / curl1_testcode.glsl
Last active December 17, 2020 07:25
simple page curl effect
vec4 mixColor( in vec4 outC, in vec3 color, float r )
{
outC.rgb = mix(outC.rgb, color, r);
return outC;
}
vec4 printPointScreen( in vec2 uv, in vec4 outC, in vec3 color, in vec2 pt )
{
cmake . -DCMAKE_TOOLCHAIN_FILE="D:\Projects\vcpkg\scripts\buildsystems\vcpkg.cmake" -DSFML_DIR=d:/projects/vcpkg/installed/x86-windows/share/sfml/ -A Win32
@newpolaris
newpolaris / dxgl.cpp
Last active November 17, 2020 13:51 — forked from mmozeiko/dxgl.c
WGL_NV_DX_interop2 example
// NV_DX_interop : https://www.khronos.org/registry/OpenGL/extensions/NV/WGL_NV_DX_interop.txt
// NV_DX_interop2 : https://www.khronos.org/registry/OpenGL/extensions/NV/WGL_NV_DX_interop2.txt
// mmonzeiko's : https://gist.github.com/mmozeiko/c99f9891ce723234854f0919bfd88eae
#include <Windows.h>
#include <d3d11.h>
#include <GL/GL.h>
#include <GL/glext.h>
#include <GL/wglext.h>
@newpolaris
newpolaris / test.cs
Created November 13, 2020 07:06
WpfThreading
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
@newpolaris
newpolaris / version_get.c
Created October 7, 2020 02:35
GL version
// "4.6.0 NVIDIA 419.17"
//
bool getVersionOpenGL(int* major, int* minor)
{
/* Thank you @elmindreda
* https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176
* https://github.com/glfw/glfw/blob/master/src/context.c#L36
*/
const char* version;
const char* prefixes[] = {
@newpolaris
newpolaris / libcurl_https.cpp
Created September 28, 2020 02:16
https curl test
// https://curl.haxx.se/libcurl/c/https.html
// https://stackoverflow.com/questions/14987857/what-exactly-is-cacert-pem-for
// https://curl.haxx.se/docs/sslcerts.html
// https://curl.haxx.se/docs/caextract.html
#include <stdio.h>
#include <curl/curl.h>
#define HAS_CERT 1
OfficePreComp.hpp
buildfiles_internal_skia.min
buildfiles_i18n.min
buildfiles_freetype2.min
buildfiles_simd.min
buildfiles_libeopt.min
buildfiles_common.min
buildfiles_hunspell.min
buildfiles_harfbuzz2.min
8/05 16:08:28: Launching 'app' on samsung SM-G950N.
$ adb shell am start -n "com.example.hellojni/com.example.hellojni.HelloJni" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.example.hellojni | com.example.hellojni.test
Waiting for application to come online: com.example.hellojni | com.example.hellojni.test
Connecting to com.example.hellojni
Connected to process 1488 on device 'samsung-sm_g950n-ce02171274eac21b04'.
Now Launching Native Debug Session
$ adb shell cat /data/local/tmp/lldb-server | run-as com.example.hellojni sh -c 'cat > /data/data/com.example.hellojni/lldb/bin/lldb-server && chmod 700 /data/data/com.example.hellojni/lldb/bin/lldb-server'
$ adb shell cat /data/local/tmp/start_lldb_server.sh | run-as com.example.hellojni sh -c 'cat > /data/data/com.example.hellojni/lldb/bin/start_lldb_server.sh && chmod 700 /data/data/com.example.hellojni/lldb/bin/start_lldb_server.sh'
Starting LLDB server: /data/data/com.example.hellojni/lldb/bin