Skip to content

Instantly share code, notes, and snippets.

@gnunicorn
gnunicorn / making-tracing-static.rs
Created Sep 9, 2020
a short `cargo play` example of building `'static tracing_core::Metadata<'static>` from non-static strings
View making-tracing-static.rs
//# lazy_static = "1.4.0"
//# tracing = "0.1.19"
//# tracing-core = "0.1.16"
//# parking_lot = "0.10"
use tracing;
use tracing_core;
use parking_lot::Mutex;
#[macro_use]
View cargo tree.txt
substrate-client v0.1.0 (file:///home/ben/dev/parity/substrate/substrate/client)
├── ed25519 v0.1.0 (file:///home/ben/dev/parity/substrate/substrate/ed25519)
│ ├── base58 v0.1.0
│ ├── blake2-rfc v0.2.18
│ │ ├── arrayvec v0.4.7
│ │ │ └── nodrop v0.1.12
│ │ └── constant_time_eq v0.1.3
│ ├── hex-literal v0.1.1
│ │ ├── hex-literal-impl v0.1.1
│ │ │ └── proc-macro-hack v0.4.1
View compile.error
Compiling triehash v0.1.2
Compiling jsonrpc-macros v8.0.1 (https://github.com/paritytech/jsonrpc.git#98e892b0)
error[E0308]: mismatched types
--> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/triehash-0.1.2/src/lib.rs:141:2
|
138 | fn gen_trie_root<A: AsRef<[u8]>, B: AsRef<[u8]>>(input: &[(A, B)]) -> H256 {
| ---- expected `ethereum_types::H256` because of return type
...
141 | keccak(stream.out())
| ^^^^^^^^^^^^^^^^^^^^ expected struct `ethereum_types::H256`, found struct `hash::H256`
@gnunicorn
gnunicorn / cargo.toml
Created Jun 4, 2018
testing connection leaking of parity's jsonrpc
View cargo.toml
[package]
name = "json-rpc-tester"
version = "0.1.0"
authors = ["Benjamin Kampmann <ben@gnunicorn.org>"]
[dependencies]
jsonrpc-ipc-server = { git = "https://github.com/paritytech/jsonrpc.git" }
jsonrpc-pubsub = { git = "https://github.com/paritytech/jsonrpc.git" }
log = "*"
env_logger = "*"
View connect_to_launcher.py
import requests
from requests.auth import HTTPDigestAuth
import json
url = 'http://localhost:8100/auth'
#url = 'http://api.safenet/auth'
payload = {
"app": {
"name": "Testing",
View dc_migration_helper.rb
NEW_SERVER = "http://community.hackership.org"
def find_all_cats(category_id)
Category.where(:parent_category_id => category_id).pluck(:id) << category_id
end
def replace_topic_with_permalink(topic)
current = topic.relative_url
Permalink.new(:url => current, :external_url => "#{NEW_SERVER}#{current}").save
View keybase.md

Keybase proof

I hereby claim:

  • I am ligthyear on github.
  • I am techcreationist (https://keybase.io/techcreationist) on keybase.
  • I have a public key whose fingerprint is 3127 E8B7 8AF0 F85B E356 7241 B9C0 1D7D D160 98D8

To claim this, I am signing this object:

View OS-Profile-Outline.md

Intro to the reader:

This is a potential outline for blog posts profiling and covering open source tech ventures. The objective of these posts is to show that there is a variety of financing models to sustain Open (-Source) Tech Ventures. A secondary objective is to give more exposure and visibility to the projects.

Please take a look at the following structure and provide feedback whether you think this is achieving these goals, as well as this covers the important aspects of your venture. Please comment on anything you deem important to mention. Still this is just a draft, so if you think I should start over, please mention that, too.

Thank you for your time and feedback!


View adsense_injct.tmpl.yml
b61f24d89806d16ef6e980c10a068434:
path: 5
---
{{#if Discourse.Mobile.mobileView}}
{{adsenseBlock "320" "50" "topic_bottom_mobile"}}
{{else}}
{{adsenseBlock "728" "90" "topic_bottom"}}
{{/if}}
View Contract Killer 3.md

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.