View gist:fa4deb2b4c71ffcd726b24b7ab581ae2
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import daemon
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/daemon.py", line 70
os.umask(022) # Don't allow others to write
^
SyntaxError: invalid token
View pandas_example.py
#!/usr/bin/env python
"""What is the difference between map and apply?"""
import pandas as pd
df = pd.DataFrame([(1, 2, 3), (5, 6, 7), (9, 0, 1), (3, 4, 5)],
columns=list('abc'),
index=['India', 'France', 'England', 'Germany'])
View gist:e9b072c5314d3d5d2507aba8a86b0d6e
>>> df = pd.DataFrame([{'id': 1, 'price': 123, 'name': 'anna', 'amount': 1},
... {'id': 1, 'price': 7, 'name': 'anna', 'amount': 2},
... {'id': 2, 'price': 42, 'name': 'bob', 'amount': 30},
... {'id': 3, 'price': 1, 'name': 'charlie', 'amount': 10},
... {'id': 3, 'price': 2, 'name': 'david', 'amount': 100}])
>>> df
amount id name price
0 1 1 anna 123
1 2 1 anna 7
View .config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@github.com:MartinThoma/scipy.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
View gist:67b67875acf038b1a01a4af30a02cb1c
i Asana-Math: A font to typeset maths in Xe(La)TeX and Lua(La)TeX
i Type1fonts: Font installation guide
i academicons: Font containing high quality icons of online academic profiles
i accanthis: Accanthis fonts, with LaTeX support
i accfonts: Utilities to derive new fonts from existing ones
i accfonts.x86_64-linux: x86_64-linux files of accfonts
i addfont: easier use of fonts without LaTeX support
i adforn: OrnementsADF font with TeX/LaTeX support
i ae: Virtual fonts for T1 encoded CMR-fonts
i aecc: Almost European Concrete Roman virtual fonts
View output.txt
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
takimata sanctus est Lorem ipsum dolor sit amet.
• Lorem ipsum 123456789 foo bar
• Lorem ipsum 123 456 789 foo bar
• Lorem ipsum 123 456 789 foo bar
• Lorem ipsum 123 456 789 foo bar
View output.txt
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet,
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
takimata sanctus est Lorem ipsum dolor sit amet.
• Lorem ipsum 123456789 foo bar
• Lorem ipsum 123 456 789 foo bar
View table_gen.py
#!/usr/bin/env python
import random
random.seed(0)
rows = 100
cols = 15
word_file = "/usr/share/dict/words"
WORDS = open(word_file).read().splitlines()
View gist:8ea9d4013f5e782fe8979c3271f6d761
x = (1/3, 2/3)
y = (1/2, 1/2)
z = (1/2, 1/2)
d(x, y) = 1 - (1/3 + 1/2)
= 1/6
d(x, z) = d(x, y)
d(y, z) = 0
d(x, z) = 1/6 = 1/6 = d(x, y) + d(x, z)
View download_pdf_test.py
#!/usr/bin/env python
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
def get_browser():
"""
Get a chrome browser with disabled PDF viewer.