Skip to content

Instantly share code, notes, and snippets.

View chadoh's full-sized avatar
🌲

Chad Ostrowski chadoh

🌲
View GitHub Profile
@chadoh
chadoh / near-riffs-as-js.js
Created July 7, 2022 18:58
sketching out what different Riffs sort of look like, conceptually
class Owner {
storage: string
get_owner(): string {
return this.storage
}
set_owner(account_id: string): void {
this.storage = account_id
}
@chadoh
chadoh / sccache-error.log
Created July 15, 2021 00:34
Error I get when trying to use sccache (in an attempt to save disc space on my machine) in nearcore running `make sandbox`
core ⮀ master ⮀ make sandbox
CARGO_PROFILE_RELEASE_DEBUG=true cargo build -p neard --features sandbox
Compiling unicode-xid v0.2.1
Compiling proc-macro2 v1.0.24
Compiling syn v1.0.60
Compiling libc v0.2.86
Compiling autocfg v1.0.1
Compiling cfg-if v1.0.0
Compiling serde_derive v1.0.123
Compiling serde v1.0.123
@chadoh
chadoh / chadlog.md
Last active August 12, 2021 16:58
what has Chad been doing

Image

In decentralized version

Given an image, in any file format, when you add it to IPFS (ipfs add), you get a content ID like "qm1"

In centralized version

@chadoh
chadoh / example.rs
Created September 21, 2020 23:40
super rough pseudocode, brainstorming how to duplicate some lengthy metadata as few times as possible in a NEAR smart contract
struct Token {
id: u64,
metadata_id: u64,
}
let metadata_vec = vec![];
let metadata_map = HashMap::new(); // String to metadata_vec index of this String
let creator_id_to_metadata_ids = HashMap<String, Vec<u64>>::new();
fn fetch_token(id: u64) -> Token {

Exploring Defi

He tried to read an elementary economics text; it bored him past endurance, it was like listening to somebody interminably recounting a long and stupid dream. He could not force himself to understand how banks functioned and so forth, because all the operations of capitalism were as meaningless to him as the rites of a primitive religion, as barbaric, as elaborate, and as unnecessary. In a human sacrifice to deity there might be at least a mistaken and terrible beauty; in the rites of the money-changers, where greed, laziness, and envy were assumed to move all men's acts, even the terrible became banal.

— Ursula K. Le Guin, The Dispossessed


2020-06-26

@chadoh
chadoh / the-dispossessed-quotes.md
Last active July 8, 2020 02:52
Quotes form Ursula K. Le Guin's "The Dispossessed"

I think men mostly have to learn to be anarchists. Women don't have to learn.

There was always a kind of psychological clear space around Mitis, like the lack of clouds around the peak of a mountain. The absence of all enhancements and enforcements of authority left the real thing plain. There are people of inherent authority; some emperors actually have clothes.

To be whole is to be part; true voyage is return.

Letters! Letters to propertarians, to subjects of governments founded on the inequity of power, to individuals who were inevitably exploited by and exploiters of others, because they had consented to be elements in the State-Machine. Did such people actually exchange ideas with free people in a nonaggressive, voluntary manner? Could they really admit equality and participate in intellectual solidarity, or were they merely trying to dominate, to assert their power, to possess?

@chadoh
chadoh / near.org.md
Last active June 25, 2020 04:09
Chad's proposal for the near.org home page

Below is my proposal for the near.org home page. Each main heading corresponds to a section of the site.

The first section, as I explain it below, requires significant legwork:

  • A refactor of near-shell & near-api-js
  • The creation of conventions & suggested patterns that don't exist yet, so we can extract them to a new tool I'm calling near generate

While I think this legwork will pay significant dividends, I want the rest of these suggestions urgently enough that I don't think it's worth waiting all that time to start implementing. The second and third sections outlined below could be implemented much more quickly; let's start there.

And maybe there's some version of the first section that we could implement more quickly. I'm open to suggestions.

  • clean up readme (including heading levels)
  • only instruct people to use npx
  • make sure near-shell does not need to be installed globally
  • auto-install packages as part of npx create-near-app
  • rm html from new project READMEs
  • include .gitignore in new projects
  • automatically init git repository?
  • automatically configure license (or encourage people to set their own)
  • remove .gitkeep from /assembly (other files already ensure it's kept)
  • fix typo "useability"
  • clean up readme (including heading levels)
  • only instruct people to use npx
  • make sure near-shell does not need to be installed globally
  • auto-install packages as part of npx create-near-app
  • rm html from new project READMEs
  • include .gitignore in new projects
  • automatically init git repository?
  • automatically configure license (or encourage people to set their own)
  • remove .gitkeep from /assembly (other files already ensure it's kept)
  • fix typo "useability"