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
# Configure DHCPv6-PD on the PPPoE interface. | |
# | |
# Prior script execution, enable IPv6 package: | |
# /system | |
# package enable ipv6 | |
# reboot | |
# | |
# Resources: | |
# https://kb.pentanet.com.au/faq/how-to-configure-a-mikrotik-routerboard-router-to-accept-ipv6 | |
# https://www.netdaily.org/tag/mikrotik-ipv6/ |
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
* @title Metamorphic Contract | |
* @author 0age, derived from cloner contract by @mhswende | |
* @notice This contract will create a metamorphic contract, or an upgradeable | |
* contract that does not rely on a transparent proxy, when deployed using | |
* CREATE2. It expects the deployer to provide a getImplementation() function | |
* that will return an implementation address, which it will then clone and | |
* deploy. Unlike with upgradeable transparent proxies, the state of a | |
* metamorphic contract will be wiped clean with each upgrade. With great power | |
* comes great responsibility - implement appropriate controls and educate the | |
* users of your contract if it will be interacted with! |
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
// SPDX-License-Identifier: GPL-3.0 | |
// solhint-disable-next-line lido/fixed-compiler-version | |
pragma solidity >=0.4.24 <0.9.0; | |
library UnstructuredStorageMap { | |
function getStorageMappingUint256(bytes32 position, uint256 key) internal view returns (uint256 data) { | |
return getStorageMappingUint256Offset(position, key, 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
const connectToKeplr = async (): Promise<any> => { | |
if (window.keplr) { | |
window.keplr | |
.experimentalSuggestChain({ | |
// Chain-id of the Regen chain. | |
chainId, | |
// The name of the chain to be displayed to the user. | |
chainName: 'Regen Devnet', | |
// RPC endpoint of the chain. | |
rpc: 'http://devnet.regen.network:26657', |
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
#!/bin/sh | |
# Reset Parallels Desktop's trial and generate a casual email address to register a new user | |
rm /private/var/root/Library/Preferences/com.parallels.desktop.plist /Library/Preferences/Parallels/licenses.xml | |
jot -w pdu%d@gmail.com -r 1 |
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 { create, globSource } = require('ipfs-http-client') | |
const globSourceOptions = { | |
recursive: true | |
} | |
const addOptions = { | |
pin: true, | |
wrapWithDirectory: true, | |
timeout: 10000 |
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
class Middleware { | |
constructor() { | |
// Array prototype last | |
if (!Array.prototype.last) { | |
Array.prototype.last = function() { | |
return this[this.length - 1]; | |
} | |
} |
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 pipeline, { Middleware } from './pipeline'; | |
const step1: Middleware<any, any> = (req, res, next) => { | |
if (req.body) { | |
console.log(`STEP 1: \n req: ${JSON.stringify(req)}\n res: ${JSON.stringify(res)}`); | |
next(); | |
} | |
} | |
const step2: Middleware<any, any> = async (req, res, next) => { |
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
// set-up a connection between the client and the server | |
var socket = io.connect(); | |
// let's assume that the client page, once rendered, knows what room it wants to join | |
var room = "abc123"; | |
socket.on('connect', function() { | |
// Connected, let's sign-up for to receive messages for this room | |
socket.emit('room', room); | |
}); |
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
//rename unused contracts to '--' and run script | |
CustomContracts.find().fetch().map( | |
function(m) { if (m.name == '--') {CustomContracts.remove(m._id);}} | |
) |
NewerOlder