Skip to content

Instantly share code, notes, and snippets.

@dekanbro
dekanbro / NFTsale.sol
Created June 8, 2020 03:01
Simple nft sale contract
pragma solidity ^0.6.0;
// OZ release-v3.0.0
import "github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol";
import "github/OpenZeppelin/openzeppelin-contracts/contracts/utils/Counters.sol";
import "github/OpenZeppelin/openzeppelin-contracts/contracts/access/Ownable.sol";
contract NFTSale is ERC721, Ownable {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
@dusanmarsa
dusanmarsa / clipboard-paste-image.js
Created October 29, 2017 08:43
JavaScript - Clipboard API - Paste image handler
var IMAGE_MIME_REGEX = /^image\/(p?jpeg|gif|png)$/i;
var loadImage = function (file) {
var reader = new FileReader();
reader.onload = function(e){
var img = document.createElement('img');
img.src = e.target.result;
var range = window.getSelection().getRangeAt(0);
range.deleteContents();
@paceaux
paceaux / tinyRules.css.md
Last active April 3, 2024 01:19
Tiny rules for how to name things in CSS and JS

Tiny rules for how to name stuff

CSS

How to name CSS classes

Stateful Class names

Is it a state that is only one of two conditions? (i.e. a boolean)