Skip to content

Instantly share code, notes, and snippets.

@kyranjamie
kyranjamie / countries.enum.ts
Last active April 28, 2024 09:30
TypeScript enum Country Codes ISO 3166
export enum Country {
Afghanistan = 'AF',
AlandIslands = 'AX',
Albania = 'AL',
Algeria = 'DZ',
AmericanSamoa = 'AS',
Andorra = 'AD',
Angola = 'AO',
Anguilla = 'AI',
Antarctica = 'AQ',
@kyranjamie
kyranjamie / migrate-labels-no-spaces.js
Created March 12, 2024 12:14
Script to remove all spaces from Github labels
// Super hacky script to paste into dev tools to remove spaces from github labels
[...document.querySelectorAll(".js-label-list > div")].forEach(async (el, i) => {
await new Promise((resolve) => setTimeout(resolve, 400 * i));
const edit = el.querySelector(".js-edit-label");
edit?.click();
const label = el.querySelector('[placeholder="Label name"]');
const value = label?.getAttribute("value");
const newValue = value?.replaceAll(' ', '')
console.log(newValue)
label?.setAttribute("value", newValue);
@kyranjamie
kyranjamie / keycodes.ts
Created August 3, 2016 10:07
TypeScript Browser Key Codes Enum
enum keyCodes {
BACKSPACE: 8,
TAB: 9,
ENTER: 13,
SHIFT: 16,
CTRL: 17,
ALT: 18,
PAUSE: 19,
CAPS_LOCK: 20,
ESCAPE: 27,
Swagger schema validation failed.
#/paths/~1ordinals~1v1~1/get/responses/200/content/application~1json/schema/properties/server_version must NOT have additional properties
#/paths/~1ordinals~1v1~1/get/responses/200/content/application~1json/schema/properties/server_version must have required property '$ref'
#/paths/~1ordinals~1v1~1/get/responses/200/content/application~1json/schema/properties/server_version must match exactly one schema in oneOf
#/paths/~1ordinals~1v1~1/get/responses/200/content/application~1json/schema must have required property '$ref'
#/paths/~1ordinals~1v1~1/get/responses/200/content/application~1json/schema must match exactly one schema in oneOf
#/paths/~1ordinals~1v1~1/get/responses/200 must have required property '$ref'
#/paths/~1ordinals~1v1~1/get/responses/200 must match exactly one schema in oneOf
#/paths/~1ordinals~1v1~1inscriptions/get/parameters/0/schema/anyOf/0 must NOT have additional properties
#/paths/~1ordinals~1v1~1inscriptions/get/parameters/0/schema/anyO
:root {
--hiro-logo-frame6: 0 0;
--hiro-logo-frame5: 0 -53px;
--hiro-logo-frame4: 0 -106px;
--hiro-logo-frame3: 0 -159px;
--hiro-logo-frame2: 0 -212px;
--hiro-logo-frame1: 0 -265px;
--img: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIkAAAE+CAYAAAC5nDOwAAAXV0lEQVR42uydeagVVRzHf6+Zufe+1VLzaYhFZbaYLRQpGplRGoWkpaFpUbYTVkjRYlpGtPdHQTtEi1G5BJFJtplWaJuGqSVaqS2SaT417bnV70dPeBx+M3fmntm67/uBH9m7c8/MPed7zu9sc34EAAAAAAAAAACAaqam6LpDC647m22W53k3EoiPguNcwBk7o725rjuYkqfRvK/nOE9SBfDzTvJc9x/DPiQQD5yZXxmZ20pETZQsUrADzIKtUCRF+a5mRNSJgB2lUukwJXPnUwpwy/Gucd/djY2NXSg69X4ikRaRgB3su68zM5b/NpGSp5Ny33WVat1PJFwJDidg7Wq+MDJ2pzTfKYizv1Lrp1mk94aS3noCdtTW1vZSat+8lFzNHOO+e4iozmZ04znOEyyW1QXP+5HTn0sgltp8rdLkX56Rq1lLIJeuZpEyqimlMKo5Q3EN9xHIF8Vi8YiMXI2I8yPF1dQTyJ2ruUlp8q+g5OkKVxMLDlt9mzlJiWSpUVi7UnI1pyuu5n4qT0k6plEshhbvkTD3UfKtQVpq/uwq89qS655JlVGQOS3ukE/lsltl5iF31n/izx4sFAr9YilHTuhoxdW8l5Kred+4796QrqZJro9iMTzr1jD34Ydv3j9g5IKaIu7T93rPu5mi4XJ5jeLvbonw2/8uOM5Yq6kMWfxSHv7KTFyN46wmpgpEIiO2P43PbEUiaX4n36vQNsg0R6Ui+dpIbIfUghRczUD
export interface PostConditionStx {
principal: PostConditionPrincipal;
condition_code: PostConditionFungibleConditionCode;
amount: string;
type: "stx";
}
export interface PostConditionFungible {
principal: PostConditionPrincipal;
condition_code: PostConditionFungibleConditionCode;
type: "fungible";
@kyranjamie
kyranjamie / docs.md
Created May 4, 2022 15:10
How to install Ledger Nano S test app

Guide to installing a developer preview Ledger Stacks app build

To test out the developer preview build of the Hiro Wallet supporting Ledger, you'll need the latest version of the Stacks app on Ledger.

The test app is only supported for Ledger Nano S & Nano S Plus devices.

⚠️ This app is for test purposes only. We recommend using a device that is solely used for development, and does not contain any real funds.

Product: a crypto portfolio value tracker
During this conversation, we’ll talk about building a cryptocurrency portfolio tracker. Users can track the value of their portfolio across various cryptocurrencies.
Features
- Track token (cryptocurrency) prices
- Track the value of your own token holdings
- Add historical transactions (i.e. when the user bought or sold a token)
@kyranjamie
kyranjamie / openapi.yaml
Created October 20, 2021 15:59
Flattened OpenAPI spec (sans broken entries)
This file has been truncated, but you can view the full file.
openapi: 3.0.2
servers:
- url: 'https://stacks-node-api.mainnet.stacks.co'
description: Mainnet
- url: 'https://stacks-node-api.testnet.stacks.co'
description: Testnet
- url: 'http://localhost:3999'
description: Local
info:
title: Stacks 2.0 Blockchain API
@kyranjamie
kyranjamie / gist:b54d2b78894ffbc7cc2816f73afd983f
Last active October 20, 2021 10:57
Restish with Stacks Blockchain API
This file has been truncated, but you can view the full file.
# Setting up Restish for Stacks Blockchain API
[Read about Restish here](https://rest.sh/#/configuration)
## Install
```
# Add the tap
$ brew tap danielgtaylor/restish