Skip to content

Instantly share code, notes, and snippets.

@vmunix
vmunix / bulk_mint_red_tickets.js
Created July 20, 2021 21:07
MeebitsDAO red ticket script
const NFT = await hre.ethers.getContractFactory("MeebitsDAOAchievements");
const contract = NFT.attach(CONTRACT_ADDRESS);
for (let i = START_FROM; i <= users.length; i++) {
const user = users[i];
const metadata = createMetadata(SERIES, current_series_id);
const pinataName = `achievement_token_#${current_series_id}_metadata.json`;
const uri = await pinToIPFS(pinataName, metadata);
const run = async () => {
@vmunix
vmunix / TicketTokens.sol
Last active July 20, 2021 20:56
MeebitsDAO red ticket solidity contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract MeebitsDAOTickets is

Keybase proof

I hereby claim:

  • I am vmunix on github.
  • I am markmayo (https://keybase.io/markmayo) on keybase.
  • I have a public key ASBtYRAaZwz_VbkM5KC9jLQ-lnPmJIEFAJTRJEMevkFKMQo

To claim this, I am signing this object:

namespace ConsoleApplication {
class Program
{
static void Main(string[] args)
{
List<int> things = new List<int>() { 10, 20, 31, 40 };
// ... Find index of first odd
int oddIndex = things.FindIndex(x => x % 2 != 0);
Console.WriteLine(oddIndex);
}
--
Join the fight against e-mail overload:
– Focus on your priorities; I'll understand if you don't reply.
– Sorry if I don't reply; I'm trying to focus, too.
– If it's urgent, reach me by Twitter or SMS.
@vmunix
vmunix / gist:3923695
Created October 20, 2012 15:53 — forked from jedp/gist:3922102
Blog Draft - Tracking Down Memory Leaks in Node.JS

#Tracking Down Memory Leaks in Node.js

Last month, the Identity team at Mozilla delivered the first beta release of Persona. Getting to this point, we built a lot of tools to help us achieve the scalability and performance that Persona demands, and to help us with problems ranging from debugging to localization to dependency management and more. As a team, we hope our solutions will be useful to other developers, and of course we hope that other developers will help us make our tools even better. So we're kicking off a series of blog posts in which we're going to talk about

@vmunix
vmunix / gist:1067964
Created July 6, 2011 18:25
git log format
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
@vmunix
vmunix / mysql_pid_fslatency_slowlog0.d
Created April 24, 2011 05:33
MySQL slow queries caused by filesystem latency
#!/usr/sbin/dtrace -s
/*
* mysqld_pid_fslatency_slowlog0.d Print slow filesystem I/O events.
*
* USAGE: ./mysql_pid_fslatency_slowlog0.d mysqld_PID
*
* This traces all mysqld filesystem I/O (including some that may be
* asynchronous to queries and not causing query latency), and prints
* those individual I/O taking longer than the MIN_FS_LATENCY_MS tunable.
*
@vmunix
vmunix / mysqld_pid_fslatency.d
Created April 24, 2011 05:18
MySQL FS Latency DTrace script
#!/usr/sbin/dtrace -s
/*
* mysqld_pid_fslatency.d Print file system latency distribution every second.
*
* USAGE: ./mysqld_pid_fslatency.d -p mysqld_PID
*
*/
#pragma D option quiet
#!bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#