This file contains hidden or 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 http.client | |
import json | |
class ApiUsers(object): | |
def getUsers(self): | |
conn = http.client.HTTPSConnection("reqres.in") | |
conn.request("GET", "/api/users") | |
r1 = conn.getresponse().read() | |
This file contains hidden or 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
// sleep time expects milliseconds | |
function sleep (time) { | |
return new Promise((resolve) => setTimeout(resolve, time)); | |
} | |
// Usage! | |
sleep(500).then(() => { | |
// Do something after the sleep! | |
}); |
This file contains hidden or 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
# Intalling mysql | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password dev_env' | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password dev_env' | |
sudo apt-get -y install mysql-server | |
mysql -uroot -pdev_env -e "create database dev" |
This file contains hidden or 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 pickle | |
a,b,c,d=[1],[3],[5],[7] | |
a.append(2) | |
b.append(4) | |
c.append(6) | |
d.append(8) | |
with open('test.pk','wb') as fo: | |
pickle.dump(a,fo) |