This file contains 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
import { AsyncLocalStorage } from 'async_hooks' | |
import nanoid from 'nanoid' | |
export const traceIdLocalStorage = new AsyncLocalStorage() | |
async function addTraceIdToRequest(ctx, next) { | |
const traceId = await nanoid() | |
ctx.set('X-Trace-ID', traceId) | |
traceIdLocalStorage.run({ traceId }, next) | |
} |
This file contains 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
import fs from 'fs' | |
import path from 'path' | |
import qs from 'querystring' | |
import httpsProxyAgent from 'https-proxy-agent' | |
import axios from 'axios' | |
const outDir = './images/' | |
const baseUrl = 'https://www.deviantart.com/_napi/da-browse/api/tags' | |
const userAgent = 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11' | |
let proxies = [ |
This file contains 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
loader.js:1014 received input: frame = 501, effective = 504, time = 8.3499, my_time = 8.4999, my_frame = 510 | |
loader.js:1014 rollback at 511 to 501 | |
loader.js:1014 frame sim took 70ms | |
loader.js:1014 frame sim took 5ms | |
loader.js:1014 frame sim took 6ms | |
loader.js:1014 frame sim took 4ms | |
loader.js:1014 frame sim took 5ms | |
loader.js:1014 frame sim took 5ms | |
loader.js:1014 frame sim took 4ms | |
loader.js:1014 frame sim took 4ms |
This file contains 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
bool netplay_manager::rollback(unsigned long long before_frame) | |
{ | |
if (m_debug) | |
{ | |
NETPLAY_LOG("rollback at %llu to %llu", m_frame_count, before_frame); | |
} | |
auto sys_start_time = system_time(); | |
netplay_assert(before_frame <= m_frame_count); // impossible to go to the future |
This file contains 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
#ifndef __THREADSAFEQUEUE_H | |
#define __THREADSAFEQUEUE_H | |
#include <mutex> | |
#include <condition_variable> | |
template <typename T, typename Container> | |
class Queue | |
{ | |
public: |
This file contains 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
function(context, args) | |
{ | |
var SERVICE_USER = "foobar" | |
var CURRENT_USER = context.caller | |
function user_sells_rep(amount) { | |
var send_result = #s.rep.bank({ send: true, to: BANK_USER, from: CURRENT_USER, amount: amount }) | |
if(!send_result.ok) { | |
return { ok: false, msg: "Failed to create deposit transaction: " + send_result.msg } | |
} |
This file contains 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
// Hackmud Token API | |
// | |
// Authors: | |
// nlight (aka facebook.com) | |
// | |
// -- Motivation -- | |
// | |
// The token API allows for the existence of unhackable* user issued in-game currencies running on a network of FULLSEC scripts. | |
// Each implementation (instance) of the API represents a supply of tokens (currency) the ownership of which can be transferred | |
// securely between users. The user who hosts the token script (the issuer) is in full control of the supply and can issue new |
This file contains 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
function(context, x) | |
{ | |
if(!x) x = {} | |
var _ = (c, x) => c.forEach(x), | |
__ = (i, x, q) => { for(q = 0; q < i; q++) { x() } }, | |
usr = context.caller, | |
ctns = (ar, it) => { | |
var f | |
_(ar, i => { | |
if(i == it) f = true |
This file contains 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
// Harvest t1 loc's in under 500 symbols | |
// Syntax: script {t: #s.some_corp.loc } | |
// Use with targets from ada.fullsec { npc: true } | |
// By nlight | |
function(c, a) | |
{ | |
var _ = (c, p) => { c.forEach(p) }, // loop utility method | |
r = a.t.call({}), // first call to get method names | |
k = /d with ([a-z]+):/.exec(r)[1], // extract command key |
This file contains 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
<template> | |
<label> | |
${label} | |
</label> | |
<br/> | |
<form autocomplete="off"> | |
<input ref="elementRef" value.bind="displayValue" class="form-control" disabled.bind="isDisabled" autocomplete="off"> | |
</form> | |
</template> |
NewerOlder