This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var devices = [ | |
{ name: 'Desktop - Huge', width: 2880, height: 1800, ratio: 2, type: 'desktop' }, | |
{ name: 'Desktop - Extra Large', width: 1920, height: 1080, ratio: 1, type: 'desktop' }, | |
{ name: 'Desktop - Large', width: 1440, height: 900, ratio: 1, type: 'desktop' }, | |
{ name: 'Desktop - HiDPI', width: 1366, height: 768, ratio: 1, type: 'desktop' }, | |
{ name: 'Desktop - MDPI', width: 1280, height: 800, ratio: 1, type: 'desktop' }, | |
{ name: 'Laptop with HiDPI screen', width: 1440, height: 900, ratio: 2, type: 'desktop' }, | |
{ name: 'Laptop with MDPI screen', width: 1280, height: 800, ratio: 1, type: 'desktop' }, | |
{ name: 'Laptop with touch', width: 1280, height: 950, ratio: 1, type: 'desktop' }, | |
{ name: 'Tablet - Portrait', width: 768, height: 1024, ratio: 1, type: 'tablet' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// View Full documentation here: https://docs.amberdata.io/reference/tokens#get-historical-token-holders | |
axios({ | |
method:'get', | |
url: 'https://web3api.io/api/v1/tokens/ETHEREUM_ADDRESS_HERE/holders/historical?timeFrame=30d', | |
headers: { 'x-api-key': 'YOUR_API_KEY_HERE' } | |
}).then(res => { | |
// res data example: | |
// { | |
// "metadata": { | |
// "columns": ["timestamp", "timestamp.holder*"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* MediaFormat | |
* format and return only needed pieces of media from their public sources | |
* Author: Trevor Clarke | |
*/ | |
function MediaFormat (){ | |
// http://www.youtube.com/embed/m5yCOSHeYn4 | |
var ytRegEx = /^(?:https?:\/\/)?(?:i\.|www\.|img\.)?(?:youtu\.be\/|youtube\.com\/|ytimg\.com\/)(?:embed\/|v\/|vi\/|vi_webp\/|watch\?v=|watch\?.+&v=)((\w|-){11})(?:\S+)?$/; | |
// http://vimeo.com/3116167, https://player.vimeo.com/video/50489180, http://vimeo.com/channels/3116167, http://vimeo.com/channels/staffpicks/113544877 | |
var vmRegEx = /https?:\/\/(?:vimeo\.com\/|player\.vimeo\.com\/)(?:video\/|(?:channels\/staffpicks\/|channels\/)|)((\w|-){7,9})/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I wanted to be able to simply change an object with key/search values, so that any array item keys that match also check for those search values | |
// The returned data, is only data that meets all requirements inside of the filterObject | |
// | |
// Example filterObject:{ | |
// names: "Trevor", | |
// countries: "USA" | |
// } | |
// Example Array: [{ | |
// title: "People in USA" | |
// names: ["Trevor", "Steve"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I contributed to the Semaphore Trusted Setup Multi-Party Ceremony. | |
The following are my contribution signatures: | |
Circuit: semaphore16 | |
Contributor # 305 | |
Hash: 20f76660 f3ecd008 f55ee086 6d669153 | |
1a8e7553 eff89313 cc848e16 de95c191 | |
172603a2 580ccf3a 9bc00185 d0dbf492 | |
70092358 115c68b8 eb45d7e3 b8474a76 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var emulatorDeviceList = [ | |
{ name: 'Amazon Kindle Fire HDX', width: 2560, height: 1600, ratio: 2 }, | |
{ name: 'Apple iPad', width: 1024, height: 768, ratio: 2 }, | |
{ name: 'Apple iPad Mini', width: 1024, height: 768, ratio: 1 }, | |
{ name: 'Apple iPhone 4', width: 320, height: 480, ratio: 2 }, | |
{ name: 'Apple iPhone 5', width: 320, height: 568, ratio: 2 }, | |
{ name: 'Apple iPhone 6', width: 375, height: 667, ratio: 2 }, | |
{ name: 'Apple iPhone 6 Plus', width: 414, height: 736, ratio: 3 }, | |
{ name: 'BlackBerry PlayBook', width: 1024, height: 600, ratio: 1 }, | |
{ name: 'BlackBerry Z30', width: 360, height: 640, ratio: 2 }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
NETWORK=mainnet | |
OWNER=sputnik-dao.$NETWORK | |
COUNCIL_ACC=CHANGE_ME.near | |
export DAO_NAME=hack #mynewdao.sputnikv2.testnet | |
##Change NODE_ENV between mainnet, testnet and betanet | |
export NODE_ENV=mainnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const WebSocket = require('ws'); | |
const ws = new WebSocket('wss://ws.web3api.io', {headers: {x-api-key:'<api_key>'}}); | |
// Events: | |
// addLiquidity 0x4d49e87d | |
// addLiquidityIbETHv2AlphaOptimal(uint256,uint256,uint256,address,uint256) 0xe52bc129 | |
// addLiquidityETHAlphaOptimal(uint256,uint256,address,uint256) 0xb057e457 | |
// addLiquidity(uint256) 0x51c6590a | |
ws.on('open', () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
import nacl from 'tweetnacl' | |
import { utils } from 'near-api-js' | |
import getNearConfig from './config' | |
require('dotenv').config() | |
// string to uint array | |
// REF: https://coolaj86.com/articles/unicode-string-to-a-utf-8-typed-array-buffer-in-javascript/ | |
function unicodeStringToTypedArray(s) { | |
const escstr = encodeURIComponent(s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const socket = new WebSocket(`wss://ws.web3api.io?x-api-key=${YOUR_API_KEY_HERE}`) | |
socket.addEventListener('open', event => { | |
console.log('Connection opened - ', event) | |
}) | |
// Closed Connection | |
socket.addEventListener('close', event => { | |
console.log('Connection closed - ', event.data) | |
}) |
NewerOlder