Skip to content

Instantly share code, notes, and snippets.

View javve's full-sized avatar

Jonny Strömberg javve

View GitHub Profile
@dvcrn
dvcrn / index.ts
Last active July 29, 2022 23:44
get metadata from metaplex
// EDIT: It's now much easier to get metadata from metaplex using the js package.
// Check the new gist here: https://gist.github.com/dvcrn/a1b0ff0a0b4b3ab02aff44bc84ac4522
// I didn't want to edit this gist because a lot of people found it helpful to see how to manually decode a account
import * as web3 from "@solana/web3.js";
import * as metadata from "./metadata"; // see metadata.ts
const tokenAddress = new web3.PublicKey(
"CxkKDaBvtHqg8aHBVY8E4YYBsCfJkJVsTAEdTo5k4SEw"
);
@mburakerman
mburakerman / package.json
Last active September 26, 2022 17:32
Webpack 4 config.js (SCSS to CSS and Babel) 👌 The Simplest Usage 👌
{
"name": "webpack-sass",
"version": "1.0.0",
"scripts": {
"start": "webpack-dev-server --open --mode development",
"build": "webpack -p"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
@trusktr
trusktr / circle.js
Created November 2, 2016 21:00
Draw a circle (pixel algorithm)
//First attempt: O(r^2)
function drawCircle(cx, cy, r) {
var dim = 100
for (let i = -r; i<=r; i+=1) {
for (let j = -r; j<=r; j+=1) {
if (
Math.round(Math.sqrt(i*i + j*j)) === r