- snippets from live coding session
- Tomasz Ducin, @tomasz_ducin
- Warsaw TypeScript #2, 2019.02.06
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
dist | |
node_modules | |
npm-debug.log | |
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
#!/usr/bin/python | |
import sys, errno | |
if len(sys.argv) != 2: | |
print 'Required parameter not passed. Run:\n\n\t./chat-bomb.py <port>\n' | |
sys.exit(errno.EINVAL) | |
port = int(sys.argv[1]) |
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
""" | |
Console module provide `copen` method for opening interactive python shell in | |
the runtime. | |
""" | |
import code | |
import readline | |
import rlcompleter | |
def copen(_globals, _locals): |
- snippets from live coding session
- Tomasz Ducin, @tomasz_ducin
- Wrocław TypeScript #3, 2019.03.27
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
// CORRECT SUBMIT EVENT: | |
// { | |
// "type": "SUBMIT", | |
// "password": "1234" | |
// } | |
// pure mocks | |
const delay = (time) => { | |
return new Promise((res, rej) => { |
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
Machine({ | |
id: 'AuthorizeDevice', | |
initial: 'chooseMethod', | |
states: { | |
chooseMethod: { | |
on: { | |
CHOOSE_ALLOW_ONCE: 'allowOnceToken', | |
CHOOSE_ADD_DEVICE: 'addDeviceForm', | |
CHOOSE_LOGOUT: 'loggedOut', | |
} |
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
Machine({ | |
id: 'AuthorizeDevice', | |
initial: 'chooseMethod', | |
states: { | |
chooseMethod: { | |
on: { | |
CHOOSE_ADD_DEVICE: 'addDeviceForm', | |
} | |
}, | |
addDeviceForm: { |
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"> | |
<title>Sinon.js fakeServer demo</title> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/sinon.js/1.7.3/sinon-min.js"></script> | |
<script src="sinon-fake-server.js"></script> | |
</head> | |
<body> |
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(root){ | |
root.getScript = function(url) { | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = url; | |
document.head.appendChild(script); | |
} | |
}(window)); | |
getScript('http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.js'); |
NewerOlder