Skip to content

Instantly share code, notes, and snippets.

View AlexanderDzhoganov's full-sized avatar

Alexander Dzhoganov AlexanderDzhoganov

  • Sofia, Bulgaria
View GitHub Profile
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)
}
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 = [
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
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
#ifndef __THREADSAFEQUEUE_H
#define __THREADSAFEQUEUE_H
#include <mutex>
#include <condition_variable>
template <typename T, typename Container>
class Queue
{
public:
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 }
}
// 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
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
// 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
<template>
<label>
${label}
</label>
<br/>
<form autocomplete="off">
<input ref="elementRef" value.bind="displayValue" class="form-control" disabled.bind="isDisabled" autocomplete="off">
</form>
</template>