Skip to content

Instantly share code, notes, and snippets.

import axios from 'axios';
const SUBGRAPH_URL =
'https://api.thegraph.com/subgraphs/name/tokenunion/polymarket-matic';
export interface Condition {
id: string;
payouts: string[];
resolutionTimestamp: number;
}
const input = [
"AND",
["<", "var1", "var2"],
[
"OR",
[">", "var3", "var4"],
["==", "var5", "var6"]
]
];
const result = "var1 < val2 AND (var3 > val4 OR val5 == val6)";
@JSRossiter
JSRossiter / instance_variables.rb
Created May 8, 2017 20:43
Instance variables exercise
class Person
attr_accessor(:name)
def initialize(name)
@name = name
end
# def name= name
# @name = name
# end
@JSRossiter
JSRossiter / music-library.js
Created May 3, 2017 23:07
Music library using object prototypes
var uid = function() {
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
}
function Library (name, creator) {
this.name = name;
this.creator = creator;
this.playlists = [];
this.tracks = [];
}