Skip to content

Instantly share code, notes, and snippets.

@keirongulrajani
keirongulrajani / parseNftDataToCanvas.worker.js
Created March 5, 2021 14:11
Web workers to encode/decode MurAll NFT data to/from HTML5 Canvas
const { leftPad, numberToHex } = require('web3-utils')
const decoder = new TextDecoder()
const numberPerGroup = 32
const maxIndexWithinGroup = 31
const numberPerIndexGroup = 16
const numberPerIndividualPixelGroup = 8
const emptyHex8 = '00000000'
const emptyHex4 = '0000'

Keybase proof

I hereby claim:

  • I am keirongulrajani on github.

  • I am thekeiron (https://keybase.io/thekeiron) on keybase.

  • I have a public key ASBF8-s5HqCqgxRFR8X_N1MPWEjU_ztm-qkZFtKDI83Cygo

@keirongulrajani
keirongulrajani / build_sound.gradle
Last active November 15, 2017 09:52
Build fail/success sounds for gradle (on Mac)
def pathToFailSoundsMac = "/Users/kgu07/Music/build_sounds/build_fail_sounds/"
def pathToSuccessSoundsMac = "/Users/kgu07/Music/build_sounds/build_success_sounds/"
//can be path relative to the project
//def pathToFailSoundsMac = projectDir.absolutePath + "/build_sounds/build_fail_sounds/"
//def pathToSuccessSoundsMac = projectDir.absolutePath + "/build_sounds/build_success_sounds/"
gradle.buildFinished {
buildResult ->
def lastFailureFile = new File(pathToFailSoundsMac + "failed.txt")
import android.support.v7.widget.GridLayoutManager;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
/**
* Created by keiron gulrajani on 29/04/2015.
*/
public class WrapContentGridLayoutManager extends GridLayoutManager {