Skip to content

Instantly share code, notes, and snippets.

@mariuswatz
mariuswatz / TezTok-getSaleStats.ql
Last active June 12, 2023 06:47
GraphQL query that will get buy and sell activities for a specified Tezos wallet for a given date range, including sale / buy sum totals and number of events.
# Copy the following GraphQL query into the TezTok API Explorer at
# https://graphiql.teztok.com/
# Fill out the wallet, date1 and date2 parameters with the Tezos address
# and date range you're interested in. The output combines events() and
# events_aggregate() query to give you a quick overview over sales and buys
# over the time period.
#
# Example:
@mariuswatz
mariuswatz / TeztokAPI-TokensReceivedHenReunion.txt
Created October 4, 2022 12:53
Demo TezTok GraphQL API query to get tokens received for a certain Tezos wallet
// Query to be run on graphiql.teztok.com/
query TokensReceivedHenReunion {
holdings(where: {first_received_at: {_gte: "09-29-2022"}, amount: {_gte: "0"}, holder_address: {_eq: "tz2NY3Fgt5QufrYGP1JKdvLKcWWt86sLsqrS"}}) {
amount
token {
fa2_address
token_id
name
description
artifact_metadata
@mariuswatz
mariuswatz / UMovesDownloader.pde
Last active August 29, 2015 14:05
Tool to download all your Moves data in JSON format, from a provided starting date until the current day.
/*
UMovesDownloader.pde
Marius Watz, August 2014
http://workshop.evolutionzone.com
Retrieves JSON data from Moves (http://www.moves-app.com/),
from a provided start date until the current date. Days for
which a data file already exists are skipped.
@mariuswatz
mariuswatz / EmojiColorsCSV.pde
Last active August 29, 2015 14:04
Extract dominant colors from a set of Emoji images, export to CSV
import toxi.color.Histogram;
import java.util.Iterator;
/**
* EmojiColorsCSV.pde - Marius Watz, 2014
* http://workshop.evolutionzone.com
*
* Download the file "Emoji.zip" from this URL:
* https://github.com/mariuswatz/teaching/blob/master/EmojiColorsCSV/Emoji.zip
*
@mariuswatz
mariuswatz / frameOptions.pde
Last active September 16, 2016 17:13
Set display options for Processing window: Disable frame borders, set always-on-top and position on screen.
// Marius Watz - http://workshop.evolutionzone.com
//
// Window frame control: Disable frame decoration (see
// init() function), manipulate frame position (see
// keyPressed(), draw() )
int framePosX=0;
int framePosY=0;
@mariuswatz
mariuswatz / iOStoEpochTime.java
Created May 29, 2014 22:40
Convert iOS timestamp to Java Date time (milliseconds)
import java.util.Calendar;
long IOSOFFSET=-1;
// parameter "t" is a iOS timestamp, stored as seconds since Jan 1, 2001.
long iOStoEpochTime(long t) {
// calculate IOSOFFSET if necessary
if (IOSOFFSET<0) {
// Objective-C timestamps are in seconds since Jan 1, 2001, while
@mariuswatz
mariuswatz / PrimeList.pde
Last active August 29, 2015 14:01
Parse prime number lists as provided by http://primes.utm.edu/
// Marius Watz - http://workshop.evolutionzone.com
//
// Parse prime number lists as provided by http://primes.utm.edu/
import java.util.*;
ArrayList<Integer> primes;
String filename="Primes-1000.txt";
void setup () {
@mariuswatz
mariuswatz / UConfigFile.pde
Last active August 29, 2015 14:00
How to use java.util.Properties to store config parameters in an external file.
/*
Marius Watz, April 2014
http://workshop.evolutionzone.com
How to load a config file using the java.util.Properties class.
Useful for sketches that require login/password or API secrets.
*/
@mariuswatz
mariuswatz / ULoremIpsum.java
Last active August 29, 2015 13:58
Lorem Ipsum text replacer for anonymizing text in data sets (email, direct messages etc.)
/*
Marius Watz, April 2014
http://workshop.evolutionzone.com
Simple Lorem Ipsum text replacer, using the "loremData" string as
dictionary for replacement words and "whitelistData" for words that
should be used unchanged.
The class uses two built-in dictionaries: A list of replacement words
@mariuswatz
mariuswatz / ChromeTimestamp.java
Created April 1, 2014 04:42
Convert Chrome (webkit) timestamp to Unix timestamp
// Marius Watz - http://workshop.evolutionzone.com
//
// Convert webkit timestamps to the UNIX timestamps used in Java.
// Written to deal with timestamps from the Chrome browser history
// database (stored as SQLite)
import java.util.*;
import java.text.SimpleDateFormat;
SimpleDateFormat df=new SimpleDateFormat("YYYY MMM dd HH:mm");