Skip to content

Instantly share code, notes, and snippets.

@Montoya
Montoya / fileStorage.js
Last active February 2, 2020 20:26 — forked from rally25rs/fileStorage.coffee
Cordova File API Wrapper
/* modified from https://codingwithspike.wordpress.com/2014/12/29/using-deferreds-with-the-cordova-file-api/ */
/* requires rsvp.js */
/* tested and working in iOS and Android on latest Cordova (5.2.0) and File plugin (4.0.0) */
/* uses dataDirectory which is not synced to iCloud on iOS. You can replace each reference to syncedDataDirectory, but then you will need to set cordova.file.syncedDataDirectory = cordova.file.dataDirectory on Android to maintain compatibility */
window.fileStorage = {
write: function (name, data) {
var name_arr = name.split('/');
var name_index = 0;
<!doctype>
<html>
<body>
<script type="text/javascript">
/* by m0nt0y4 */
function binaryAgent(arr) {
var charcoded = [],
finalStr = '',
i;
Verifying my Blockstack ID is secured with the address 1D2MgVQ5dXQwqobMbtE1qsdHRzaWE5CJ3g https://explorer.blockstack.org/address/1D2MgVQ5dXQwqobMbtE1qsdHRzaWE5CJ3g
<!doctype>
<html>
<body>
<script type="text/javascript">
/* by m0nt0y4 */
function binaryAgent(arr) {
var charcoded = [],
finalStr = '',
i;
@Montoya
Montoya / getElementsByClassNamePolyfill.js
Last active November 1, 2018 00:42 — forked from stereobooster/function.js
getElementsByClassName polyfill
/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, curly:true, browser:true, indent:2, maxerr:50 */
(function (document) {
"use strict";
if (!document.getElementsByClassName) {
document.getElementsByClassName = function (match) {
var result = [],
elements = document.body.getElementsByTagName('*'),
i, elem;
match = " " + match + " ";
for (i = 0; i < elements.length; i++) {
@Montoya
Montoya / allowlist.csv
Last active September 16, 2022 23:47
Chublins v1 Mint Allowlist
Count Address
1 0x0d09427435ef687368b7311b6c85c59024526dcf
2 0xd5cd2e1dbd1abecd87c3cd1884b435a6129bf232
3 0xe90c19c5294f71417bf3eb6a8712f0cf1045dd61
4 0x2d10719acf66f475d0ac8d9b8c9fd01a86fe7c77
5 0xddc24a93e743c6f9595027f6de7abeca3fda08b4
6 0xa59a83e47f0825fc5d4fc1534c0719dc5454017e
7 0x5c559c000a856938fdd00c8de027f605de65a63a
8 0xbd2f5f18eabc4c2cef2d80dd97d3676af96af6fc
9 0x92b3f3854f60977fdcd3b74975c0159d2202c246
@Montoya
Montoya / convert.js
Created September 19, 2022 03:59
SVG to PNG from contract
const Web3 = require('web3');
const { convert } = require('convert-svg-to-png');
const fs = require('fs');
/* this assumes you have:
- an Infura account
- a smart contract with a read method "tokenSVG" that takes one argument "tokenID" and returns the SVG content as a string
*/
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/v3/'+YOUR_API_KEY));
const abi = YOUR_ABI;
@Montoya
Montoya / chublist.csv
Created September 19, 2022 06:43
Chublist
count address
1 0x3310fd13c6C55F054cC128439e1E51Cd0cb16Fed
2 0xbC1eB4359ab755Af079F6EF77E3FaAc465e53EDA
3 0xF20bF55B7FcbCc6A1f1D6AD4cd60ccCfEd01c8Ce
4 0x3d283913e7C11379F11809a9B8e7F06bfB283140
5 0x9F432A2964351a7830bD9EA10F65107677d73e04
6 0x5848AAEaCD1580b7A93cf92651F2d143CBe2d6c5
7 0x1f61C84De5355c3a4ea09be15068a97460eF8835
8 0x1aBa86a31a3c3E0957574997d1e2945017F1107D
9 0x0ccab1b6df6E319d1F53FF041c9fc797939F6929
@Montoya
Montoya / index.php
Last active February 10, 2024 19:18
chublins.xyz frame code
<?php $chub = rand(0, 442); ?>
<!DOCTYPE html>
<html>
<head>
<title>Chublins.xyz</title>
<style type="text/css">
body { background:#000; }
#chub { position:absolute; top:50%;left:50%; margin:-300px 0 0 -300px; }
</style>
<meta property="og:title" content="Chublins" />
@Montoya
Montoya / index.php
Last active February 10, 2024 20:15
Random Moonbird Frame for Farcaster
<?php $bird = mt_rand(0, 9999); ?>
<!DOCTYPE html>
<html>
<head>
<title>Random Moonbirds</title>
<meta property="og:title" content="Moonbirds" />
<meta property='og:image' content="https://proof-nft-image.imgix.net/0x23581767a106ae21c074b2276D25e5C3e136a68b/<?=$bird?>?auto=format&fit=max&w=384&q=75" />
<meta property="fc:frame" content="vNext" />
<meta property="fc:frame:image:aspect_ratio" content="1:1" />
<meta property="fc:frame:image" content="https://proof-nft-image.imgix.net/0x23581767a106ae21c074b2276D25e5C3e136a68b/<?=$bird?>?auto=format&fit=max&w=384&q=75" />