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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HelloWorld</title> | |
</head> | |
<body> | |
<h1> Hello World! </h1> | |
<script> | |
console.log("Hello Console!") |
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
https://habrahabr.ru/post/331348/ |
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
export LC_ALL="en_US.UTF-8" | |
export LC_CTYPE="en_US.UTF-8" | |
sudo dpkg-reconfigure locales |
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 twisted.internet import task | |
from twisted.internet import reactor | |
timeout = 60.0 # Sixty seconds | |
def doWork(): | |
#do work here | |
pass | |
l = task.LoopingCall(doWork) |
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
class JSONEncoder(json.JSONEncoder): | |
def default(self, o): | |
if isinstance(o, ObjectId): | |
return str(o) | |
return json.JSONEncoder.default(self, o) |
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
bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda -k //tensorflow/tools/pip_package:build_pip_package |
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
sudo sgdisk -Z /dev/sdc Wipe guid partition table | |
sudo apt-get purge `dpkg -l | awk '{print $2}' | grep -E 'gnome|unity'` Wipe unity | |
sudo apt-get install bumblebee bumblebee-nvidia primus linux-headers-generic for NVidia Optimus cards |
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 urllib2 | |
#put your link here =) | |
url = "http://ichart.finance.yahoo.com/table.csv?s=^GSPC&c=2016" | |
file_name = "table.csv" #can parse fname from url, ofcoz. | |
u = urllib2.urlopen(url) | |
gspc = u.read() | |
with open(file_name, 'wb') as 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
#python2 | |
from email.utils import parsedate_tz | |
import datetime | |
z = parsedate_tz('Fri, 1 Jan 2016 17:58:28 +0700') | |
print z | |
print datetime.datetime.strptime('{}-{}-{}'.format(z[0],z[1],z[2]), '%Y-%m-%d').timetuple().tm_yday | |
output: | |
''' | |
(2016, 1, 1, 17, 58, 28, 0, 1, -1, 25200) |
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
sudo rsync -azv -e "ssh -i /home/ubuntu/key-to-ec2.pem" [email protected]:/home/ubuntu/source/ /home/ubuntu/target |
NewerOlder