This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {createStore} = require('redux') | |
// Actions are mapped to state here, called a Reducer | |
function setIntervalState(state= 0, action) { | |
switch(action.type){ | |
case 'START_TIMER': | |
return state = action.payload | |
case 'STOP_TIMER': | |
if(state !== 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://plato.stanford.edu/entries/lambda-calculus/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gs -o inverted.pdf \ | |
-sDEVICE=pdfwrite \ | |
-c "{1 exch sub}{1 exch sub}{1 exch sub}{1 exch sub} setcolortransfer" \ | |
-f input.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:syncfusion_flutter_calendar/calendar.dart'; | |
import 'package:syncfusion_flutter_core/core.dart'; | |
void main() { | |
return runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// // All rounded up values in kilos | |
// itemTransferMinimums = { | |
// 'Fastner': '2000' | |
// } | |
// function myround(x, roundUp){ | |
// return base * Math.ceil(x/roundUp); | |
// } | |
// frappe.ui.form.on('Stock Entry', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frappe.db.get_list('BOM') | |
frappe.db.insert({ | |
doctype: 'Stock Entry', | |
stock_entry_type: 'Material Receipt', | |
items: [ | |
{ | |
'item_code': '0002', | |
'item_name': 'Spring Clip', | |
'schedule_date': '30 - 11 - 2021', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.8; | |
/* | |
Just the interface so solidity can compile properly | |
We could skip this if we use generic call creation or abi.encodeWithSelector | |
*/ | |
contract ERC20 { | |
function totalSupply() public view returns (uint); | |
function balanceOf(address tokenOwner) public view returns (uint balance); | |
function allowance(address tokenOwner, address spender) public view returns (uint remaining); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bip39 = require("bip39"); | |
const hdkey = require("hdkey"); | |
const createHash = require("create-hash"); | |
const bs58check = require("bs58check"); | |
const mnemonic = bip39.generateMnemonic(); //generates string | |
const seed = bip39.mnemonicToSeedSync(mnemonic).toString('hex'); //creates seed buffer | |
const root = hdkey.fromMasterSeed(seed); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bip39 = require("bip39"); // mnemonic generator | |
const hdkey = require("hdkey"); // wallet lib | |
const ethUtil = require("ethereumjs-util"); // Used here for public address and public key generation | |
const mnemonic = bip39.generateMnemonic(); // generates string | |
const seed = bip39.mnemonicToSeedSync(mnemonic).toString('hex'); // creates seed for wallet | |
const root = hdkey.fromMasterSeed(seed); | |
const masterPrivateKey = root.privateKey.toString('hex'); |