Skip to content

Instantly share code, notes, and snippets.

View zapu's full-sized avatar
:octocat:
hi

Michał Zochniak zapu

:octocat:
hi
View GitHub Profile
@zapu
zapu / stress.iced
Last active December 27, 2019 13:42
Stress test for toffee
toffee = require './index'
fs = require 'fs'
path = require 'path'
os = require 'os'
# Create pressure on the node runtime to force infavorable preemption ordering in toffee.
pressure = () ->
loop
Buffer.alloc(1024).fill('A')
await setTimeout defer(), 10 * Math.random()
kbpgp = require '../kbpgp'
{Message} = kbpgp.processor
await kbpgp.KeyManager.import_from_armored_pgp {
armored: """-----BEGIN PGP PUBLIC KEY BLOCK-----
mI0EWT7ZgAEEAMzYy+AJehsdFUEbY2hcY32qHe0QaqX/OMm97TGcGx/v1Fvtn3l1
7LnFAe7aDlBn1VnCqnqrU5lDjcY9mep0FuphYvPdoHVydbhxa0hwRr0UcyZ+caRj
yooG7FKmguqlr+yKe7qK13nOGeHcNSCP/1pRh6/IUnt6HIRb+zMBFl7hABEBAAG0
EFJTQSBDcmFzaGVyIFRlc3SItwQTAQgAIQUCWT7ZgAIbAwULCQgHAgYVCAkKCwIE
@zapu
zapu / gulpfile.js
Created March 2, 2017 11:03
boilerplate gulpfile for typescript and react with vendor packages
'use strict';
const gulp = require('gulp');
const browserify = require('browserify');
const watchify = require('watchify');
const babelify = require('babelify');
const buffer = require('vinyl-buffer');
const source = require('vinyl-source-stream');
const sourcemaps = require('gulp-sourcemaps');
const del = require('del'); // why the fuck does deleting files need separate package

Keybase proof

I hereby claim:

  • I am zapu on github.
  • I am zapu (https://keybase.io/zapu) on keybase.
  • I have a public key ASCsyqC-K0gjXeg9BDHzJ6UNxjPmuIxtbI_bRlWgqOO7fAo

To claim this, I am signing this object:

diff --git a/openpgp/ecdh/ecdh.go b/openpgp/ecdh/ecdh.go
index 92c366d..949c9bc 100644
--- a/openpgp/ecdh/ecdh.go
+++ b/openpgp/ecdh/ecdh.go
@@ -223,6 +223,21 @@ func (e *PrivateKey) DecryptShared(X, Y *big.Int) []byte {
return Sx.Bytes()
}
+func countBits(buffer []byte) int {
+ var headerLen int
public static class MonoBehaviourEx
{
public static bool FetchComponent<T>(this MonoBehaviour beh, out T obj) {
obj = beh.GetComponent<T>();
return obj != null;
}
}
// example:
kbpgp = require 'kbpgp'
{exec, spawnSync} = require('child_process')
###
gpg_gen_cv25519.txt is:
%echo Generating cv25519
Key-Type: eddsa
Key-Curve: Ed25519
Key-Usage: sign
@zapu
zapu / .vimrc
Created July 27, 2016 15:46
A tiny "good defaults" .vimrc, for use when I have to use vim on some server that I need to reconfigure, and there is no good .vimrc present.
syntax on
" indents, whitespace
set autoindent " keep indenting on newlines
set tabstop=4 "
set shiftwidth=4 " one tab = four spaces (autoindent)
set softtabstop=4 " one tab = four spaces (tab key)
set smarttab "
set expandtab " don't use hard tabs
@zapu
zapu / loop_host.cpp
Created May 13, 2016 09:01
Ultima 6 Online
#include "define_both.h" /* luteijn: won't really be included again, but helps with auto-completion of variable names. */
if (NEThost){ //host
//U6O_ERRORTAG
btime2+=et/150.0f; //non-rolled over btime!
x=btime2/24;
btime=btime2-(float)x*24.0f;
x%=7; bday=x+1;
@zapu
zapu / heh.coffee
Created October 5, 2015 11:22
iced-coffee-script loop problems
delay = (func) ->
setTimeout func, 1
arrEq = (a, b) ->
r = a.length is b.length and a.every (elem, i) -> elem is b[i]
if not r
console.log 'arrays not equal', a, '!=', b
console.trace()
await delay defer()