Skip to content

Instantly share code, notes, and snippets.

View drj11's full-sized avatar

David Jones drj11

View GitHub Profile
@drj11
drj11 / ASCII.md
Last active October 23, 2022 03:35
How to memorise ASCII

How to memorise ASCII

You don't need to memorise ASCII as there is a handy chart available by typing man ascii in a Terminal. However, you may find it useful to remember some fun facts about ASCII.

Blocks of 32 are useful. 32 is 2⁵ (2 raised to the power 5) and a block of 32 is enough to represent all 26 common english letters plus some extra stuff.

ASCII is a coding for the first 128 numbers. 0 to 127.

@drj11
drj11 / git-pop.md
Last active May 23, 2016 15:33
10 most git
$ grep ^git ~/.bash_history | sort | uniq -c | sort -rn | head
     37 git diff
     22 git status
     20 git push origin HEAD
     16 git commit -a -v
      8 git rebase
      6 git fetch
      5 git commit -v
 5 git checkout develop
for current_attempt in range(MAX_DNS_ATTEMPTS):
print("Checking for DNS record, attempt: {}/{}".format(current_attempt+1, MAX_DNS_ATTEMPTS))
try:
dns_answer = dns.resolver.query(host, 'TXT')
if not dns_answer:
continue
for dns_rrset in dns_answer.rrset:
@drj11
drj11 / pathway
Created June 10, 2016 09:34
Metabolic Pathway Starter List
Pentose and glucuronate interconversions (KEGG)
Fructose and mannose metabolism (KEGG)
Lysine degradation (KEGG)
Starch and sucrose metabolism (KEGG)
Pantothenate and CoA biosynthesis (KEGG)
Nitrogen metabolism (KEGG)
Phase I, non P450 (Wikipathways)
Ganglio Sphingolipid Metabolism (Wikipathways)
Urea cycle and metabolism of amino groups (Wikipathways)
Biogenic Amine Synthesis (Wikipathways)
@drj11
drj11 / pcxnbrief.md
Last active June 10, 2016 10:52
PCXN brief

We would like you to have a look at the website http://pcxn.org/ and provide a brief critique of no more than 200 words.

To guide you, we've written out a suggestion to get you started (below). Please try this and spend about 10 minutes having a poke about. Write up your thoughts, paying particular attention to what you would do to improve things.

Please e-mail your written critique (200 words max) to david.r.jones@sheffield.ac.uk; Any questions or clarifications to the same e-mail address.

Suggested starting point.

Average CPU job: 4900 seconds

$ awk -F: '{print $35, $37}' 1percent | awk '{a+=$2};END{print a/NR}'
4852.23

Average number of cores, per CPU second

awk -F: '{print $35, $37}' 1percent | awk '{p+=$1*$2;a+=$2}; END {print p/a}'
@drj11
drj11 / colourtext.md
Last active July 28, 2016 09:41
My notes on text for presentations

2016-07-27

Observing a presentation that was mostly text on a white background, displayed on a projector.

  • black on white - good
  • green on white - terrible
  • blue on white - legible, but difficult to distinguish from black
  • light blue on white - ok
  • cyan on white - mostly terrible
  • red on white - ok
@drj11
drj11 / srds.md
Created August 9, 2016 09:41
SRDS

SRDS - SECTION A

2016-08-09 David Jones

1) Achievements

Delivey of Refinery platform on AWS. This is underway. A basic version works and it continues to be refined.

Contributed to planning of CGT.

@drj11
drj11 / binding.py
Created November 3, 2016 13:50
A closure example
def p():
v = [0]
def x():
print(v)
x()
v = [7]
x()
p()
@drj11
drj11 / sharing.py
Created November 3, 2016 14:01
structure sharing
a=[1]
b=['b']
c=['c']
b.append(a)
c.append(a)
print(b)
print(c)
b[1].append('xyz')
print(b)
print(c)