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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://cdn.peerjs.com/0.3.8/peer.js"></script> | |
<script type="text/javascript" src="./overload-peerjs.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="./overload-webrtc.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
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 config = { | |
peer: { // The object to pass to the Peer constructor. | |
options: { | |
host: 'localhost', | |
port: '9000', | |
key: 'peerjs' | |
} | |
}, | |
debug: false, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<script type="text/javascript" src="http://underscorejs.org/underscore-min.js"></script> | |
<script type="text/javascript" src="http://cdn.peerjs.com/0.3.8/peer.js"></script> | |
<script type="text/javascript" src="./webrtc-relay.js"></script> |
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
import os | |
import struct | |
dataset_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), | |
'dataset') | |
def load_mnist_dataset(): | |
"""This implementation is just for my training. | |
You should use other popular libraries to load mnist dataset.""" |
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
from matplotlib import pyplot as plt | |
import mnist | |
train_imgs, train_labels, test_imgs, test_labels = mnist.load_mnist_dataset() | |
plt.imshow(train_imgs[0], cmap='gray') | |
plt.show() |
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
CREATE OR REPLACE FUNCTION ULID_ENCODE(IN value BYTEA) | |
RETURNS VARCHAR(26) | |
LANGUAGE plpgsql | |
IMMUTABLE | |
STRICT | |
AS $$ | |
DECLARE | |
chars CHAR(1)[] := ARRAY['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z']; | |
BEGIN | |
RETURN CONCAT( |