Skip to content

Instantly share code, notes, and snippets.

@gnunicorn
gnunicorn / main.dart
Last active May 23, 2023 14:40
decadent-dart-7321
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:shared_preferences/shared_preferences.dart';
enum Feature {
/*
* Mass Emailer Google Spreadsheet script.
*
* Changelog:
*
* 27. Apr. 2013
* - trial checkbox allows easier debugging
* 16. Feb. 2012
* - released the first version to public
* 15. Feb. 2012
@gnunicorn
gnunicorn / making-tracing-static.rs
Created September 9, 2020 17:49
a short `cargo play` example of building `'static tracing_core::Metadata<'static>` from non-static strings
//# 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]
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
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 / emailer.js
Last active August 25, 2018 13:04
Mass emailer with auto reply for forms
/*
* Mass Emailer Google Spreadsheet and Forms Script.
*
* Changelog:
* 19. June 2013
* - also copy CC and BCC from draft email
* 27. May 2013
* - bugfix, kudos to @stefanhoth: the col is called "Email"
* - show the quota left for the day (thanks to @stefanhoth)
* 30. Apr. 2013

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.

@gnunicorn
gnunicorn / cargo.toml
Created June 4, 2018 18:33
testing connection leaking of parity's jsonrpc
[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 = "*"
import requests
from requests.auth import HTTPDigestAuth
import json
url = 'http://localhost:8100/auth'
#url = 'http://api.safenet/auth'
payload = {
"app": {
"name": "Testing",
@gnunicorn
gnunicorn / forms.html
Created October 13, 2011 16:02
Jinja2 WTForms macros for twitter bootstrap
{%- macro form_field_label(field) -%}
<label for="{{ field.id }}">{{ field.label.text }}
{%- if field.flags.required -%}
<abbr title="Diese Feld muss angegeben werden">*</abbr>
{%- endif %}</label>
{% endmacro %}
{%- macro form_field_description(field) -%}
{% if field.description %}
<span class="descr">{{ field.description }}</span>