Skip to content

Instantly share code, notes, and snippets.

View drj11's full-sized avatar

David Jones drj11

View GitHub Profile
# With "unamed expressions"
x = 1 + 2 + 3 + 4
# Without:
x = 1
x += 2
x += 3
x += 4
@drj11
drj11 / gist:d66c78ea55954d6e6fd0
Created February 3, 2016 11:53
vagrant provision broken
drj@mus:~/prj/refinery-platform$ vagrant provision
==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: WARNING: $GALAXY_DATABASE_DIR is not set: copying files from local Galaxy instance will not work.
==> default: Running provisioner: shell...
default: Running: /tmp/vagrant-shell20160203-7267-75tc0j.sh
==> default: stdin: is not a tty
==> default: Reading package lists...
==> default: Building dependency tree...
2016-02-18
Feedback for CICS course "Help I need to use R"
That is a terrifying amount of weight to put on a USB pen drive.
When explaining «setwd("U:\\R - course")» instructor swapped backslash and forward slash.
And repeated it.
So this is not an isolated incident.
Confusion on library. For me on Ubuntu, just «library(psych)» works. No need to use second argument.
@drj11
drj11 / codecafe.md
Last active March 10, 2016 15:26
R code cafe notes

no-one is using the etherpad.

by 1745 (15 minutes in) some people had made a plot, most people downloading and installing.

by 1800 (30 minutes in), many people have a plot.

installing on arch and gentoo is hard (arch user gave up installing Rstudio and used command line; gentoo user had to use VNC!). Installing on Ubuntu was hard too.

Someone asked "what does pch=1 do?" (in the call to legend)

from __future__ import print_function
class S():
_ = print("executing class S")
x = 1
y = x
print("S.y", S.y)
try:
@drj11
drj11 / iterwat.py
Created April 13, 2016 20:44
Produces wrong error in Python 3
#!/usr/bin/env python3
def it():
x=1
yield 1
"{:d}".format(x.bit_length) # try changing to assert 0
yield 2
print(max(*it()))
@drj11
drj11 / response.md
Last active April 19, 2016 20:56
Land Registry Consultation Response

consultation document https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/510987/BIS-16-165-consultation-on-moving-land-registry-operations-to-the-private-sector.pdf

the consultation makes references to "Autumn Statement" and "the Chancellor" (executive summary, para 2, page 5) without further explanation or reference to these documents and roles. That detracts from the clarity of the consultation document.

executive summary, para 3, page 5, asserts that the Land Registry underpins a valuable property market, without qualifying that by explaining that not all land (or even owned land) is in the registry.

@drj11
drj11 / id_rsa.pub
Created April 24, 2016 08:46
My public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8QHn4M2w2ZEIpYdx+dZDwhvWdrzotiHxG75EIRsDVdt/WdKKvMifFdj7j4i1nR1fzjEDusDIWw3y7JSagueE/vIGnEfV4mvxLQiM73X8c+7EgwF4LpD98BKR1HMvdgvqbSBQwxLnZJfVGjsxxkTl+UWzQVWIU4xFepfYcofinELdBCg3B8I5c96md0cL2XpUNINO9kLKxsDrlLGVw9w5q77HdDjthqkJhiPFebVa4mda4kwX0auCnp4XZe0WOOMYrvVLmL4RpyV80k3sBznl48b/tnCiDOjQV9q7+49l47+EVqXGnDfjMn0dmnGwGpeeqyTPksqwIa13IlPEbFzCT drj@ash
@drj11
drj11 / README.md
Created April 25, 2016 16:02
Why I like `sh thing`

How to use strace to solve a mystery (with bash)

So I'm dabbling with iceberg, The University of Sheffield's HPC, and I finally get round to putting my .profile on there. And I remember that I don't like the way less clears the screen when I've finished reading a man page.

I need to set my LESS environment variable to -X. So I add that to my .profile. I do exec bash -l to emulate logging back in.