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/env python | |
import datetime as dt | |
def riddle_for_date(date, solutions=False): | |
""" | |
Determines the number for the Saturday Mac Riddle associated with | |
a given date, considering whether it is the date for the riddle | |
or the solutions. |
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
\documentclass{article} | |
\usepackage{hyperref} | |
\usepackage{makeidx} | |
\usepackage{glossaries} | |
\makeindex | |
\makeglossaries | |
% Define your acronym |
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
# This script assumes that [mdbtools][1] are installed, for instance with | |
# `brew install mdbtools` | |
# [1]: https://github.com/mdbtools/mdbtools | |
# It also assumes that [pandas][2] and [pandas_access][3] are installed, | |
# [2]: https://pandas.pydata.org/ | |
# [3]: https://pypi.org/project/pandas_access/ | |
# which you can do with | |
# `pip install pandas pandas_access` | |
# or | |
# `pip install pandas_access` |
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/env python | |
# Based on https://chuoi.org/posts/checkexchangeemailandsendemailwithpython/ | |
"""Description | |
A Python script to check email exchange mailbox, download require attachment and send email to user. | |
Use: | |
cd /path/to/file && python3 main.py | |
""" | |
import os |
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
digraph pictionary_play { | |
node [fontname = "Handlee"]; | |
edge [fontname = "Handlee"]; | |
splines=false; | |
randir=LR; | |
draw [ | |
label = "Draw a picture"; |
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/env python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
gh_url = 'https://api.github.com' | |
req = urllib2.Request(gh_url) | |
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() |
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
scp yzhang@linux04.cs.uh.edu:~/packages/scidb-15.7.0.9267.tgz ./ | |
tar -xzf scidb-15.7.0.9267.tgz | |
mv scidb-15.7.0.9267/ scidbtrunk | |
sudo apt-get update | |
sudo apt-get -y install subversion expect openssh-server openssh-client | |
# The following environment variables should go into ~/.bashrc | |
export SCIDB_VER="15.7" | |
export SCIDB_SOURCE_PATH="/home/scidb/scidbtrunk" |
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
let $reqLabel := for $c in /innoslate/schema/schemaClass | |
where $c/name="Requirement" | |
return $c/@id | |
let $L2label := for $l in /innoslate/labels/label | |
where $l/name="L2" | |
return $l/@id | |
for $e in /innoslate/database/entity | |
where $e/schemaClassId=$reqLabel and $e/labelId[contains(child::text(), $L2label)] |
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 atlassian import Confluence # requires atlassian-python-api | |
cf_user = os.environ['CONFLUENCE_USER'] # requires environment variable | |
cf_pwd = os.environ['CONFLUENCE_PWD'] | |
cf_url = os.environ['CONFLUENCE_URL'] | |
cf_space = os.environ['CONFLUENCE_SPACE'] | |
# Content preparation | |
my_title = "Testing Confluence API" | |
html_body = """<p>Paragraph 1</p> | |
<p>Paragraph 2</p> |
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 sys | |
import os | |
from atlassian import Confluence | |
def obtain_confluence_pat(path='~/.ConfluencePAT'): | |
confluence_PAT_filename = os.path.expanduser(path) | |
confluence_PAT = None | |
if os.path.exists(confluence_PAT_filename): | |
with open(confluence_PAT_filename, "r") as pat_file: | |
confluence_PAT = pat_file.readline() |
NewerOlder