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 { Readable, Writable } from "stream"; | |
import { commandOptions, createClient } from "redis"; | |
export const createWriteStream = (client: ReturnType<typeof createClient>, key: string, opts?: { ttlMs?: number }) => | |
new Writable({ | |
objectMode: false, | |
construct: (callback) => | |
client | |
.del(key) | |
.then(() => callback()) |
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
using System; | |
using System.Collections.Generic; | |
using System.Windows; | |
using Caliburn.Micro; | |
using Ninject; | |
namespace Maca134.Stuff | |
{ | |
internal abstract class NinjectBootstrapper<TViewModel> : BootstrapperBase | |
{ |
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 { readFileSync } from 'fs'; | |
import { parse } from 'protobufjs'; | |
if (!process.argv[2]) throw new Error('no arg'); | |
const file = readFileSync(process.argv[2]); | |
if (!file) throw new Error('no file'); | |
const root = parse(` | |
package chromeextensionid; |
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
@ECHO off | |
SETLOCAL enableextensions enabledelayedexpansion | |
CD /D "%~dp0" | |
SET BASEPATH=%~dp0 | |
REM =============================[CONFIG START]============================= | |
SET STEAMCMDPATH=.steamcmd | |
REM Steam login details, you may need to run this twice if you have Auth Guard enabled (which you should) |
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 bigIntToBuffer(num: bigint, endian: 'be' | 'le') { | |
const bytes: number[] = []; | |
while (num > 0) { | |
bytes.push(Number(num & 0xffn)); | |
num = num >> 8n; | |
} | |
return Buffer.from(endian === 'be' ? bytes.reverse() : bytes); | |
} | |
function bufferToBigInt(bytes: Buffer, endian: 'be' | 'le') { |
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
namespace SQLiteTableBuilder | |
{ | |
[Table] | |
public class Group | |
{ | |
[Column(PrimaryKey = true, AutoIncrement = true)] | |
public int Id { get; set; } | |
[Column(Unique = true)] | |
public string Name { get; set; } |
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
private _traders = []; | |
{ | |
_traders pushBack [ | |
typeOf _x, | |
(_x get3DENAttribute 'face') select 0, | |
["HubStanding_idle1"], | |
getPosATL _x, | |
getDir _x | |
]; | |
} forEach ((get3DENSelected "group") apply {units _x select 0}); |
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
MMC_fnc_getConfig = { | |
params [ | |
['_base', configfile, [configfile]] | |
]; | |
private _inherts = inheritsFrom _base; | |
private _output = [ | |
if (configName _inherts != '') then { | |
format ['class %1 : %2 {', configName _base, configName _inherts] | |
} else { | |
format ['class %1 {', configName _base] |
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
var async = require('async'); | |
findMatches.prototype.find = function(checkhash, complete) { | |
var self = this; | |
var matches = []; | |
async.eachLimit(hashes, 5, function (hash, next) { | |
if (hamming(checkhash, hash.hash) < 10) { | |
console.log('emiiting match'); | |
self.emit('found-match', hash); | |
matches.push(hash); | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace mgroups.Core | |
{ | |
public class ArmaArray : List<object> | |
{ | |
public static ArmaArray Unserialize(string strarray) |
NewerOlder