Skip to content

Instantly share code, notes, and snippets.

View ChrisWellsWood's full-sized avatar

Christopher W. Wood ChrisWellsWood

View GitHub Profile
@ChrisWellsWood
ChrisWellsWood / pop_os_20_04_freeze.md
Created April 22, 2023 15:52
How to fix random freezes on a laptop running Pop OS 22.04

How to fix random freezes on Pop OS 22.04

I've been experiencing random screen freezes on Pop OS, where the mouse pointer can still be moved onto another screen, but one of my monitors is totally unresponsive. I tried a whole range of things to fix this (disabling high DPI, turning off extensions etc), but none of this worked.

In order to fix this, I had to disable hybrid graphics. This is an option when you have both a dedicated GPU and a integrated GPU, generally you want to use the low power integrated GPU when you're using battery. However, something is breaking this on the current version of Gnome on Pop. To disable hybrid graphics:

  1. Click on the system tray

image

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ChrisWellsWood
ChrisWellsWood / bibtex.png
Created January 6, 2020 15:23 — forked from max-mapper/bibtex.png
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@ChrisWellsWood
ChrisWellsWood / .vimrc
Created December 9, 2019 09:19
My Current .vimrc (09/12/19)
" Behaviour
set expandtab
set hidden
set path+=**
set shiftwidth=4
set spell
set spelllang=en_gb
set t_vb=
set tabstop=4
set visualbell
@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

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 / 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.