This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#define MAKE_FUNC_BODY(...) static __VA_ARGS__ { __assume(false); } | |
#define MAKE_TYPE_CONSTRAINT(Name, ...) struct Name { MAKE_FUNC_BODY(__VA_ARGS__) }; | |
template<typename T> | |
int call(int index, T const& v) { std::cout << "-["<<index<<"] " << v << std::endl; return index+1; } | |
int call(int index, std::string const& v) { std::cout << "+["<<index<<"] " << v << std::endl; return 100; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <atomic> | |
#include <iostream> | |
#include <cassert> | |
#include <map> | |
#include <unordered_map> | |
#include <libplatform/libplatform.h> | |
#include <cppgc/allocation.h> | |
#include <cppgc/garbage-collected.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PropertyInfo PackagingIncludeFiles; | |
PackagingIncludeFiles.type = Variant::ARRAY; | |
PackagingIncludeFiles.name = "MyPropertyName"; | |
PackagingIncludeFiles.hint = PROPERTY_HINT_ARRAY_TYPE; | |
PackagingIncludeFiles.hint_string = vformat("%s/%s:%s", Variant::STRING, PROPERTY_HINT_FILE, "*.abc,*.xyz"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iterator> | |
#include <cstdint> | |
#include <thread> | |
#include <JavaScriptCore/JavaScriptCore.h> | |
JSValueRef ObjectCallAsFunctionCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { | |
char buf[1024]; | |
for (int i = 0; i < argumentCount; ++i) { | |
JSValueRef val = arguments[i]; | |
if (JSStringRef str = JSValueToStringCopy(ctx, val, nullptr)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var validDivisionCharRE = /[\w).+\-_$\]]/; | |
function parseFilters(exp) { | |
var inSingle = false; | |
var inDouble = false; | |
var inTemplateString = false; | |
var inRegex = false; | |
var curly = 0; | |
var square = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace ConsoleApp1 | |
{ | |
internal class TimeHandle | |
{ | |
public uint id; | |
public Action<uint> action; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET EXE=.\bin\sgless | |
REM 杀掉所有指定进程名的进程 | |
taskkill /f /im %EXE% | |
REM 杀掉所有指定窗口名字和进程名的进程 | |
taskkill /f /im %EXE% /fi "WINDOWTITLE eq NT_CENTER" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WORKSPACE=$(cd `dirname $0`;pwd) | |
EXE=./bin/sgless | |
LOGPATH=./log | |
echo killing old | |
ps aux | grep $EXE | awk '{print $2}' | xargs kill -9 | |
sleep 1s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo building... | |
go build -o sgless | |
if %errorlevel% NEQ 0 ( | |
exit 2 | |
) | |
echo all done! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
go 获取所有网卡地址 | |
*/ | |
package main | |
import ( | |
"fmt" | |
"net" | |
) |
NewerOlder