Skip to content

Instantly share code, notes, and snippets.

Avatar

Chad Ostrowski chadoh

View GitHub Profile
View arterra-example.md

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 Sep 21, 2020
super rough pseudocode, brainstorming how to duplicate some lengthy metadata as few times as possible in a NEAR smart contract
View example.rs
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 {
View defi-notebook.md

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 Jul 8, 2020
Quotes form Ursula K. Le Guin's "The Dispossessed"
View the-dispossessed-quotes.md

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 Jun 25, 2020
Chad's proposal for the near.org home page
View near.org.md

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.

View create-near-app-notes.md
  • 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"
View create-near-app-notes.md
  • 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"
View near-studio-thoughts.md

NEAR Studio

  • can we use Glitch instead?
  • why does "open near studio" button on https://nearprotocol.com/get-started/ open in a new tab instead of current?
  • when studio first opens, I feel a little overwhelmed. Contributing factors:
    • small font size
    • needing to pick an example – which one is the best to start with??
    • i'd rather have a super simple hello-world-type app open immediately
    • this is my complete intro to the NEAR stack – it doesn't seem like it's structured like a tutorial, though. All of a sudden it's asking me to make choices about wallet integrations vs smart contracts. If I don't even know what these things are yet, I'll probably just close this page
View chadoh.readme.md

Hey! I'm Chad Ostrowski! On the Internet I go by chadoh. It's not the best nickname, but we go way back, this nickname and me.

Why you're here

Hopefully you're reading this page to learn:

  • What motivates me
  • What I like and dislike from the teams I work with
  • How to work well with me
@chadoh
chadoh / ebay-scraper.js
Last active Jan 16, 2020
node script to search ebay for a search term and print items + prices to your terminal
View ebay-scraper.js
const jsdom = require("jsdom")
const { JSDOM } = jsdom
const fetch = require('node-fetch');
const newItemRegex = new RegExp('<span class="LIGHT_HIGHLIGHT">New Listing</span>')
const scrapeEbaySearchResults = dom => console.log(
Array.from(
dom.querySelectorAll('ul.srp-results li.s-item')
).map(li => ({