Skip to content

Instantly share code, notes, and snippets.

View ChrisWellsWood's full-sized avatar

Christopher W. Wood ChrisWellsWood

View GitHub Profile
@ChrisWellsWood
ChrisWellsWood / parametric-modelling-isambard2.ipynb
Last active January 31, 2024 14:46
Parametric Modelling of Coiled Coils using ISAMBARD
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ChrisWellsWood
ChrisWellsWood / i3_config
Last active September 17, 2023 14:41
i3wm Config and Cheat Sheet
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ChrisWellsWood
ChrisWellsWood / useful_docker_commands.md
Last active August 31, 2017 14:16
Useful Docker Commands

Connect to container and run bash:

docker exec -i -t container /bin/bash

Stop all containers:

docker stop $(docker ps -a -q)

Remove all containers:

@ChrisWellsWood
ChrisWellsWood / useful_git_commands.md
Last active October 25, 2017 09:29
Useful Git Commands

A Random Selection of Useful Git Commands

Checkout

Files

1. Checkout a file from another branch

git checkout branch-with-file path/to/file.we

Merge

Conflicts

@ChrisWellsWood
ChrisWellsWood / 1_pypi_dist.md
Last active August 17, 2017 08:49
Packaging a Python Project and Distributing on PyPi

Packaging a Python Project and Distributing on PyPi

Workflow

  1. Create setup.py
    • Contains information about your project i.e. version numbers, licences, Python version
  2. Create MANIFEST.in
    • Defines files to be included/excluded from the package
    • See example below.
  3. Run create the distribution
@ChrisWellsWood
ChrisWellsWood / elm-local-storage.html
Created July 4, 2017 09:21
Catch error with local storage for Elm app
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="elm.js"></script>
</head>
<body></body>
<div id="main"></div>
<script type="text/javascript">
var node = document.getElementById('main');
@ChrisWellsWood
ChrisWellsWood / crangles_to_register.py
Last active January 4, 2017 16:15
Extract a register from a list of Crick angles.
def fit_heptad_register(crangles):
"""Attempts to fit a heptad repeat to a set of Crick angles.
Parameters
----------
crangles: [float]
A list of average Crick angles for the coiled coil.
Returns
-------
fit_data: [(float, float, float)]
Sorted list of fits for each heptad position.
@ChrisWellsWood
ChrisWellsWood / empty_rust_structs.md
Last active November 8, 2023 10:05
Initialising empty structs in Rust.

Initialising Empty Structs in Rust

In C/C++, you can initialise a struct without giving values for any of the fields:

struct Point {
  float x;
  float y;
  float z;
};
@ChrisWellsWood
ChrisWellsWood / complex_data_type_annotations.elm
Last active August 29, 2016 14:50
Complex Data and Type Annotations
import String
import Html
import List
type alias Person = { name : String
, access : List String }
type alias Location = String
ee1 = { name = "Ian Beal"