Skip to content

Instantly share code, notes, and snippets.

View ries9112's full-sized avatar

ries9112

View GitHub Profile
@ries9112
ries9112 / CV_pull_recent_audio_objkts
Created June 30, 2021 04:22
This is Ricky's CV script of the gallery that displays the most recent artwork from hic et nunc (https://www.cryptovoxels.com/play?coords=SE@6922W,34S). This is an adaptation where the GraphQL query returns data for audio objkts (as requested by @Mighty_33)
feature.on('click',e=>{
fetch('https://api.hicdex.com/v1/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
query: `
query MyQuery {
@ries9112
ries9112 / CV_pull_TheGraph
Created June 29, 2021 11:53
CV pull data using TheGraph
// add script to a button inside Cryptovoxels to return a response
feature.on('click',e=>{
// Use GraphQL endpoint to pull data and make model that takes x,y Decentraland coordinates and returns prediction based on the latest 10 sales!
fetch('https://api.thegraph.com/subgraphs/name/decentraland/marketplace', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ries9112
ries9112 / wwwwwwwwwwindows Exhibition CV Script
Last active February 15, 2022 15:16
The script for the skulls in the wwwwwwwwwwindows exhibition in CV
// FINAL SCRIPT
let skull_trigger = 0
// set length of timer for art changing
let numSecs=30
// read in all features to overwrite URLs
let w1 = parcel.getFeatureById('w1')
let w1i = parcel.getFeatureById('w1i')//finger icon for interactive objkt
@ries9112
ries9112 / hen_graphql_query.R
Last active June 6, 2021 19:36
An example of pulling data from the hic et nunc GraphQL endpoint by @marchingsquare into the R programming language for further manipulation
library(ghql)
library(jsonlite)
# Address to lookup:
address = "tz1c2iwyckUCcicx2qxqtwLEartYFEHg1pvB"
# connect to the endpoint
con <- GraphqlClient$new(
url = "https://api.hicdex.com/v1/graphql"
)
@ries9112
ries9112 / gist:450f9309cbb25768298d698d31e69537
Created June 6, 2021 16:48
Use this query to find all objkts in your collection - sorted by highest sales (both primary and secondary market). Replace 'String = "tz1c...' with your own Tezos wallet.
query findSecondarySales($address: String = "tz1c2iwyckUCcicx2qxqtwLEartYFEHg1pvB") {
hic_et_nunc_swap(where: {status: {_in: [1]}, token: {swaps: {trades: {buyer: {address: {_eq: $address}}}}}}, order_by: {price: desc}) {
price
status
token {
title
mime
description
id
artifact_uri
@ries9112
ries9112 / graphql_hen_example
Last active June 19, 2021 00:40
This is an example of using the GraphQL endpoint by @marchingsquare. This example gets data for John Karel address and finds objkts with certain tags (loose match with 'like'). Try copy/pasting this example into this editor: https://api.hicdex.com/graphiql/
query collectorGallery($address: String = "tz1gqaKjfQBhUMCE6LhbkpuittRiWv5Z6w38") {
hic_et_nunc_token(where: {trades: {buyer: {address: {_eq: $address}}}, _and: {token_tags: {tag: {tag: {_like: "jjjjjjjjjjohn"}}, _or: {token: {token_tags: {tag: {tag: {_like: "window"}}}}}}}}, order_by: {id: asc}) {
id
artifact_uri
thumbnail_uri
timestamp
mime
title
description
supply
@ries9112
ries9112 / pull_hicetnunc_data.R
Created March 30, 2021 03:28
R script to pull data from hicetnunc
library(pacman)
# Load packages
p_load('pins')
# Register Board for data pull
board_register("https://raw.githubusercontent.com/predictcrypto/pins/master/","pins_repo")
# Pull data
stats_hicetnunc <- pin_get("stats_hicetnunc", "pins_repo")
@ries9112
ries9112 / 3d_ride.R
Created January 2, 2020 18:48 — forked from slopp/3d_ride.R
Code to make pretty bike ride plots with rayshader and rStrava
source("helpers.R")
plot_3d_route_area <- function(stream, zscale = 15){
# create bounding box for the ride
ui("1 of 5: Locating Route...")
bbox <- list(
p1 = list(long = min(stream$lng), lat = min(stream$lat)),
p2 = list(long = max(stream$lng), lat = max(stream$lat))
)