Skip to content

Instantly share code, notes, and snippets.

View nikahmadz's full-sized avatar
🔰
Senior Application Developer

Nik Ahmad Z nikahmadz

🔰
Senior Application Developer
View GitHub Profile
/* @flow */
import SHA256 from 'crypto-js/sha256'
type Block = {
index: number,
previousHash: string,
timestamp: number,
data: string,
hash: string
}
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.b = factory());
}(this, (function () { 'use strict';
var popular = {
ai : 'alignItems',
b : 'bottom',
bc : 'backgroundColor',
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});