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
version: '3.3' | |
networks: | |
caddy: | |
services: | |
portainer: | |
image: portainer/portainer-ce:latest | |
container_name: portainer | |
restart: unless-stopped | |
security_opt: | |
- no-new-privileges:true |
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
function hyphenize(str) { | |
// /y is to make sure that there are no characters between the matches | |
// /g is so that .match() works the way we need here | |
// /u is not strictly necessary here, but generally a good habit | |
return str.match(/([a-z]{1,2})/uyg).join('-'); | |
} | |
assert.equal( | |
hyphenize('hello'), 'he-ll-o' | |
); |
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: MIT | |
pragma solidity >=0.7.0 <0.9.0; | |
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/token/ERC721/ERC721.sol"; | |
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/utils/Counters.sol"; | |
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/access/AccessControl.sol"; | |
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/utils/Context.sol"; | |
contract MyNFT is Context, AccessControl, ERC721 { |
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
<div class="text-right"> | |
<div class="custom-control custom-switch"> | |
<mat-checkbox type="checkbox" | |
class="custom-control-input" | |
id="darkMode" | |
[checked]="isThemeDark | async" | |
(change)="toggleDarkTheme($event)"> | |
<label class="custom-control-label" for="darkMode"></label> | |
<a class="text-capitalize">Dark Mode</a> | |
</mat-checkbox> |
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
var request = require('request'); | |
const bitcoin = require('bitcoinjs-lib'); | |
var buffer = require('buffer'); | |
const bitcoinNetwork = bitcoin.networks.testnet; | |
var rootUrl = "https://api.blockcypher.com/v1/btc/test3"; | |
//create wallets | |
const TestNet = bitcoin.networks.testnet3; |
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
function solution(N) { | |
var binary = N.toString(2); | |
var length = binary.length; | |
var ones = []; | |
for(var i=0; i<length; i++) { | |
if (binary[i]=='1') ones.push(i); | |
} | |