Skip to content

Instantly share code, notes, and snippets.

View nully0x's full-sized avatar
🎯
Building

nully0x nully0x

🎯
Building
View GitHub Profile
@BlueHippoGithub
BlueHippoGithub / docker-compose.yaml
Created August 11, 2022 18:51
Remember to change the volumes for your own desired path
version: '3.3'
networks:
caddy:
services:
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
restart: unless-stopped
security_opt:
- no-new-privileges:true
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'
);
@oliverjumpertz
oliverjumpertz / MyNFT.sol
Last active June 3, 2021 09:22
A basic ERC721 (NFT) implementation. Instantly runnable in remix.ethereum.org
// 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 {
@muhammadawaisshaikh
muhammadawaisshaikh / sample.component.html
Created May 9, 2020 09:26
Creating a Dark & Light Toggle Mode on your Angular App
<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>
@sanjukurian
sanjukurian / bitcoin.js
Created January 31, 2019 07:14
create bitcoin wallet, make a transaction on bitcoin network using bitcoinjs-lib and blockcypher
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;
@ao
ao / javascript.js
Created October 29, 2016 18:03
Codility: A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.
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);
}