Skip to content

Instantly share code, notes, and snippets.

View woss's full-sized avatar
🛸

Daniel Maricic woss

🛸
View GitHub Profile
@woss
woss / statement
Created September 15, 2020 19:55
statement
{
statement: {
id: bafy2bzacecs6xmdosu7utcb4gjqdmjq6qxw4w63prqdtstz3yj2ucnxuxpswu,
data: {
signatures: {
holder: {
sigKey: urn:pgp:5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,
sig: 0xae43651d482f10f75cac09a75834f9ac04f79f0e4b43ba37b8f047d19a3836533b7705f885ee58bf0e2d0b3989f122151d19121060147739ba70c42603a7f58c,
cid: bafy2bzacebrqcepjfdcfqqvh4n7qszffzwt63pc67orgiyx6emzpi7jy2dfdk
},
const IPFS = require("ipfs");
const OrbitDB = require("orbit-db");
// Create the first peer
async function main() {
try {
const ipfs1 = await IPFS.create({
repo: "./test/ipfs1",
init: {
emptyRepo: true,
},
@woss
woss / gitconfig
Created March 31, 2020 12:08
gitconfig
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red
! Compiling of exercises/traits/traits2.rs failed! Please try again. Here's the output:
error[E0308]: mismatched types
--> exercises/traits/traits2.rs:21:9
|
19 | fn append_bar(&mut self) -> Self {
| ---- expected `std::vec::Vec<std::string::String>` because of return type
20 | self.push(String::from("Bar"));
21 | self
| ^^^^
! Compiling of exercises/traits/traits2.rs failed! Please try again. Here's the output:
error[E0308]: mismatched types
--> exercises/traits/traits2.rs:21:9
|
19 | fn append_bar(&mut self) -> Self {
| ---- expected `std::vec::Vec<std::string::String>` because of return type
20 | self.push(String::from("Bar"));
21 | self
| ^^^^
use frame_support::{decl_module, decl_storage, decl_event, dispatch::DispatchResult, ensure, StorageMap};
use system::ensure_signed;
use serde::{Serialize, Deserialize};
use serde_json::json;
use sp_runtime::print;
use sp_std::vec::Vec;
@woss
woss / gist:ddf647b27f33124a96cbd1dd251a707e
Created March 3, 2020 08:29
runkit-hostname-not-found-while-on-nordvpn-connection-Switzerland
└─❱❱❱ curl -v https://runkit.com/home 6 ⏎ +1736 9:27 ❰─┘ * Could not resolve host: runkit.com
* Closing connection 0
curl: (6) Could not resolve host: runkit.com
@woss
woss / Object Flatten
Created October 5, 2019 18:02 — forked from penguinboy/Object Flatten
Flatten javascript objects into a single-depth object
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;
@woss
woss / Object Flatten
Created October 5, 2019 18:02 — forked from penguinboy/Object Flatten
Flatten javascript objects into a single-depth object
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;