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 uint2hexstr(uint i) internal pure returns (string) { | |
if (i == 0) return "0"; | |
uint j = i; | |
uint length; | |
while (j != 0) { | |
length++; | |
j = j >> 4; | |
} | |
uint mask = 15; | |
bytes memory bstr = new bytes(length); |
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.4.17; | |
pragma experimental ABIEncoderV2; | |
import "zeppelin-solidity/contracts/token/ERC721/ERC721Token.sol"; | |
import "zeppelin-solidity/contracts/ownership/Ownable.sol"; | |
contract NFT is ERC721Token, Ownable { | |
address private metadataContractAddress; |
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.4.13; | |
contract ReversiContract { | |
// example moves = [[4,3],[3,3],[3,4],[3,5],[4,6],[6,4],[6,3],[5,3],[4,2],[5,2],[2,5],[2,6],[6,2],[5,6],[3,6],[6,5],[7,3],[6,6],[7,5],[5,7],[4,7],[6,7],[7,6],[7,4],[1,6],[8,6],[8,4],[8,2],[8,3],[8,5],[5,8],[1,5],[6,8],[1,7],[1,4],[1,3],[2,4],[3,1],[5,1],[3,7],[3,2],[3,8],[4,8],[7,8],[7,7],[7,1],[7,2],[2,1],[2,2],[8,1],[2,7],[2,8],[1,8],[8,7],[8,8],[2,3],[1,1],[4,1],[6,1],[1,2]] | |
function testGame(uint8[2][] moves) public returns(string) { | |
Game memory game = playGame(moves); | |
if (game.error) return game.msg; | |
if (!game.complete) return game.msg; |
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 processedProducts = [] | |
var shopClient = ShopifyBuy.buildClient({ | |
accessToken: 'your-access-token', | |
domain: 'your-shop-subdomain.myshopify.com', | |
appId: '6' | |
}) | |
shopClient.fetchAllProducts().then((products) => { |
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
data:text/html,<html> <head> <script type="application/ecmascript" async="" src="http://eligrey.com/demos/FileSaver.js/FileSaver.js"></script> <script type="application/ecmascript" async="" src="http://eligrey.com/demos/FileSaver.js/Blob.js"></script> </head> <style type="text/css"> #div{position:absolute; top:0px; left:0px; width:100%; height:10000px; border:none; font-family:arial; font-size:12pt; } #div:focus{ outline: none; } body{overflow:hidden;} #saveButton{z-index:2;position:absolute;top:0px;right:0px;} iframe{width:0; height:0; padding:0;margin:0;border:0;} </style> <form id="former"> <input type="submit" value="Save" id="saveButton"> </form><textarea onkeypress="javascript:keyPressed(event);" id="div"></textarea> <script> var lastKey = ""; var keyCount = 0; function keyPressed(e){ var code; if(window.event){ code = e.keyCode; } else{ code = e.which; } console.log(code); if(code == lastKey){ keyCount++; }else{ keyCount = 0; } lastKey = code; console.log(keyCount); if(keyCount >9){ keyCount = 0; } } f |
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 selected = []; | |
$(document).ready(function(){ | |
$("#selected option:selected").each(function(i){ | |
selected.push($(this).val()); | |
}); | |
$("#selected").click(function(e){ | |
if($.inArray(e.target.value, selected) > -1){ | |
selected.splice($.inArray(e.target.value, selected),1); | |
}else{ | |
selected.push(e.target.value); |
NewerOlder