Skip to content

Instantly share code, notes, and snippets.

View kostasx's full-sized avatar
💭
Uncaught ReferenceError

Kostas Minaidis kostasx

💭
Uncaught ReferenceError
View GitHub Profile
@kostasx
kostasx / erc721-example.sol
Created November 23, 2021 21:39 — forked from aunyks/erc721-example.sol
My implementation of the ERC721 token standard. WARNING: THIS CODE IS FOR EDUCATIONAL PURPOSES. DO NOT DEPLOY TO THE NETWORK.
pragma solidity ^0.4.19;
contract ERC721 {
string constant private tokenName = "My ERC721 Token";
string constant private tokenSymbol = "MET";
uint256 constant private totalTokens = 1000000;
mapping(address => uint) private balances;
mapping(uint256 => address) private tokenOwners;
mapping(uint256 => bool) private tokenExists;
mapping(address => mapping (address => uint256)) private allowed;
mapping(address => mapping(uint256 => uint256)) private ownerTokens;
contract ERC721 {
// ERC20 compatible functions
function name() constant returns (string name);
function symbol() constant returns (string symbol);
function totalSupply() constant returns (uint256 totalSupply);
function balanceOf(address _owner) constant returns (uint balance);
// Functions that define ownership
function ownerOf(uint256 _tokenId) constant returns (address owner);
function approve(address _to, uint256 _tokenId);
function takeOwnership(uint256 _tokenId);
@kostasx
kostasx / _tsne.pdf
Created February 28, 2021 17:36 — forked from kylemcdonald/_tsne.pdf
Exploring antonyms with word2vec.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"embeddings": [
{
"tensorName": "Reviews Sentiment Analysis Vector Space",
"tensorShape": [
1000,
50
],
"tensorPath": "https://gist.githubusercontent.com/kostasx/0af4f6303ff6821476543366904e4b21/raw/1357a73b5a75fbb8d49646b471a9d19470d9238e/embedding-projector--vecs.tsv",
"metadataPath": "https://gist.githubusercontent.com/kostasx/8aa6c86651ca73d0455d546c8b2a078e/raw/61dceae3f45fd1abf7eb16964c2f92fda30ac464/embedding-projector--meta.tsv"
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 16 columns, instead of 8. in line 5.
0.11199197 -0.003564898 0.28838375 -0.02453965 -0.060024902 -0.0721752 0.084433 0.04048575 -0.0048353043 -0.010357111 -0.24254088 0.123872384 0.06795292 0.058354862 -0.0924278 0.25570905
0.087117806 -0.057186488 0.24222723 0.0046102796 0.054156974 -0.03447769 0.09587353 -0.015675819 0.009703704 -0.06351056 -0.16185245 0.097795 0.07845944 0.04366533 -0.043812513 0.20302159
-0.12033286 0.19545701 0.31732923 0.18137869 -0.1491861 0.22615197 -0.18394953 -0.22844425 0.23483802 0.17303562 -0.24325718 -0.15418604 -0.17959246 -0.18284406 -0.23760289 0.35320896
0.019094488 0.05589215 0.27747035 0.0093216635 -0.03744544 0.064165235 0.04416203 -0.00037242024 0.068225645 0.01665077 -0.22317336 0.057856657 -0.042340375 -0.035009976 -0.101763465 0.28485936
0.16710165 -0.06288179 0.22370918 -0.04430955 0.008299133 -0.12387165 0.117996536 0.022873737 -0.08183648 -0.11078356 -0.15378515 0.14609973 0.1264015 0.11722314 -0.062144615 0.13573056
0.093750045 -0.036193356 0.06635687 -0.09512182 0.025961913 -0.07996079 0.08794111 0.
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
<OOV>
the
and
i
it
a
is
to
this
was
@kostasx
kostasx / pres.md
Created February 13, 2021 08:56 — forked from whostolebenfrog/pres.md
Notes on: Instantly better presentations - Damian Conway

Instantly better presentations - Damian Conway

It probably just makes more sense to just view his version online at:

http://damian.conway.org/IBP.pdf

But making notes is useful anyway.

7 tips are

@kostasx
kostasx / post-to-codesandbox.js
Created September 24, 2020 07:16
Dynamically create a Codesandbox using a GET request and the Codesandbox API
// import * as LZString from "lz-string";
// https://cdnjs.cloudflare.com/ajax/libs/lz-string/1.4.4/lz-string.min.js
var LZString=function(){function o(o,r){if(!t[o]){t[o]={};for(var n=0;n<o.length;n++)t[o][o.charAt(n)]=n}return t[o][r]}var r=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",t={},i={compressToBase64:function(o){if(null==o)return"";var r=i._compress(o,6,function(o){return n.charAt(o)});switch(r.length%4){default:case 0:return r;case 1:return r+"===";case 2:return r+"==";case 3:return r+"="}},decompressFromBase64:function(r){return null==r?"":""==r?null:i._decompress(r.length,32,function(e){return o(n,r.charAt(e))})},compressToUTF16:function(o){return null==o?"":i._compress(o,15,function(o){return r(o+32)})+" "},decompressFromUTF16:function(o){return null==o?"":""==o?null:i._decompress(o.length,16384,function(r){return o.charCodeAt(r)-32})},compressToUint8Array:function(o){for(var r=i.c
Short-circuit? Short-circuits on? Fulfilled on? Rejected on?
Promise.all First rejected promise All promise fulfilled First rejected promise
Promise.allSettled N/A Always N/A
Promise.race First settled First promise fulfilled First rejected promise
Promise.any First fulfilled First promise fulfilled All rejected promises
@kostasx
kostasx / Microsoft 70-480 Exam Study Guide.md
Last active November 14, 2019 15:21 — forked from rgharris/Microsoft 70-480 Exam Study Guide.md
Programming in HTML5 with JavaScript and CSS3