Skip to content

Instantly share code, notes, and snippets.

View jeevanpillay0000's full-sized avatar
🎸
Jamming

jeevanpillay0000 jeevanpillay0000

🎸
Jamming
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma experimental ABIEncoderV2;
library RoundNearestPowerOfTwo {
// Counts number of set bits (1's) in 32-bit unsigned integer
function bit_count_32(uint32 n) internal pure returns (uint32) {
n = n - ((n >> 1) & 0x55555555);
n = (n & 0x33333333) + ((n >> 2) & 0x33333333);
@jeevanpillay0000
jeevanpillay0000 / ERC721StoreMultipleNFT.sol
Last active July 11, 2021 03:50
This contract is an extension to OpenZeppelin's base contract, where, the NFT can hold an NFT.
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.6.8;
// Source: https://github.com/0xmons/multisender/blob/main/contracts/Bundler.sol
import "@openzeppelin/contracts/token/ERC1155/ERC1155Holder.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
✅ did:3:bafyreigo6wyzaljvwzrc3uip2tzm3fxambgjt6v3wzcgzfnduzc2q3xz2a ✅
@jeevanpillay0000
jeevanpillay0000 / branch-clean.md
Created March 22, 2021 01:47
This file contains various different commands to clean local branches in Git.

One-line command

In some cases, it might be useful to have a one-liner in order to delete local unused branches.

For those who are curious, here is how you can delete unused local branches in one single line.

$ git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d Before executing this, let’s have a quick explanation about this command :

git branch –merged : first, you are simply listing all the branches currently merged with your current checked out branch;

@jeevanpillay0000
jeevanpillay0000 / on-jsx.markdown
Created January 17, 2021 23:02 — forked from chantastic/on-jsx.markdown
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@jeevanpillay0000
jeevanpillay0000 / Knex-Migrations-Seeding.md
Created December 28, 2020 04:25 — forked from NigelEarle/Knex-Migrations-Seeding.md
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

@jeevanpillay0000
jeevanpillay0000 / en-GB.ts
Last active November 22, 2020 03:02
crypto-locales
export default {
COMMON: {
BALANCE: "Balance",
BLOCK: "Block",
BLOCKS: "Blocks",
CONFIRMATIONS: "Confirmations",
DELEGATE: "Delegate",
DELEGATES: "Delegates",
EXPIRATION: "Expiration",
FEE: "Fee",
@jeevanpillay0000
jeevanpillay0000 / 0.suffixtree.cs
Created May 13, 2020 12:38 — forked from axefrog/0.suffixtree.cs
C# Suffix tree implementation based on Ukkonen's algorithm. Full explanation here: http://stackoverflow.com/questions/9452701/ukkonens-suffix-tree-algorithm-in-plain-english
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace SuffixTreeAlgorithm
{
public class SuffixTree
{
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreigo6wyzaljvwzrc3uip2tzm3fxambgjt6v3wzcgzfnduzc2q3xz2a ✅
Create your profile today to start building social connection and trust online at https://3Box.io/