Skip to content

Instantly share code, notes, and snippets.

# - find where dlopen and friends are located.
# DL_FOUND - system has dynamic linking interface available
# DL_INCLUDE_DIR - where dlfcn.h is located.
# DL_LIBRARY - libraries needed to use dlopen
include(CheckFunctionExists)
find_path(DL_INCLUDE_DIR NAMES dlfcn.h)
find_library(DL_LIBRARY NAMES dl)
if(DL_LIBRARY)
include(ECMFindModuleHelpersStub)
ecm_find_package_version_check(XKBCommon)
# Note that this list needs to be ordered such that any component
# appears after its dependencies
set(XKBCommon_known_components
XKBCommon
X11)
#include <sys/signal.h>
#include <unistd.h>
void handler()
{
write(2, "a\n", 2);
}
int main(void) {
signal(SIGSEGV, handler);
### Keybase proof
I hereby claim:
* I am wengxt on github.
* I am csslayer (https://keybase.io/csslayer) on keybase.
* I have a public key whose fingerprint is 2CC8 A060 9AD2 A479 C65B 6D5C 8E8B 898C BF24 12F9
To claim this, I am signing this object:
@wengxt
wengxt / introspect.c
Last active April 2, 2017 04:40
introspect.c
/* Copyright (c) 2017-2017 Weng Xuetian
* Copyright (c) 2007-2014 Massachusetts Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
#include <fcitx-utils/metastring.h>
#include <iostream>
template<int b>
class ItoA2 {
public:
using cur = typename ItoA2<b % 10>::type;
using remain = typename ItoA2<b / 10>::type;
using type = typename fcitx::ConcatMetaString<remain, cur>::type;
};
@wengxt
wengxt / org.test.Fcitx.json
Created October 27, 2017 16:40
fcitx in flatpak test
{
"app-id": "org.test.Fcitx",
"runtime": "org.gnome.Platform",
"runtime-version": "3.24",
"sdk": "org.gnome.Sdk",
"command": "/usr/bin/zenity",
"finish-args": [
"--share=ipc", "--socket=x11",
"--env=GTK_IM_MODULE_FILE=/app/lib/gtk-3.0/3.0.0/immodules.cache"
],
# coding: utf-8
import requests
import json
import time
import sys
import random
from threading import Thread
#输入你对应的authkey和sign
auth_key = ''
@wengxt
wengxt / test.cpp
Last active March 7, 2018 17:48 — forked from yume-chan/test.cpp
#include <functional>
#include <iostream>
template <class F>
struct wrapper {
F f;
};
template <class F>
import sys
import random
prob = float(sys.argv[1]) if len(sys.argv) > 1 else 0.015
acc = 0
award = 0
total = 1000000
g = 100