Skip to content

Instantly share code, notes, and snippets.

💭
 

Stuart Axon stuaxo

💭
 
Block or report user

Report or block stuaxo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@stuaxo
stuaxo / Screenshot-Notepad.ipynb
Created Dec 7, 2018
Screenshot a single window
View Screenshot-Notepad.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stuaxo
stuaxo / dmesg-without-amdgpu.txt
Created Nov 23, 2018
dmesg on 4.20rc on HP Envy 15 Inch. modprobe.blacklist=amdgpu
View dmesg-without-amdgpu.txt
[ 0.000000] Linux version 4.20.0-rc3 (root@Main-PC) (gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)) #1 SMP Mon Nov 19 15:18:07 CET 2018
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.20.0-rc3 root=UUID=5fbe26ec-88dd-4b0f-8e57-c577efacffc7 ro quiet splash idle=nomwait amdgpu.audio=0 amdgpu.dc=1 modprobe.blacklist=amdgpu
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009ffff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000000a0000-0x00000000000fffff] reserved
@stuaxo
stuaxo / Notebook with PNG.ipynb
Created Oct 3, 2018
Demonstrate inline png image
View Notebook with PNG.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stuaxo
stuaxo / rails.ipynb
Created May 22, 2018 — forked from l15n/rails.ipynb.json
Rails and Jupyter
View rails.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View toy_inheritance_example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stuaxo
stuaxo / models.py
Created Mar 7, 2018
Wagtail FormViewPage
View models.py
class FormViewPage(Page):
"""
Allow a wagtail Page to render a FormView.
"""
def __init__(self, view, *args, **kwargs):
self.view = view
Page.__init__(self, *args, **kwargs)
def serve(self, request):
"""
@stuaxo
stuaxo / cloudfoundry_python.sh
Last active Jul 31, 2018
Set up cloud foundry python to run interactively
View cloudfoundry_python.sh
vh="/home/vcap/deps/0"; for fn in $vh/env/*; do f=`basename $fn` && grep -q "/deps/0" $fn && cmd="export $f=/home/vcap$(sed "s#^/[^/]*/[^/]*##" $fn)" || cmd="export $f=$(cat $fn)" && echo $cmd; $cmd; done; export LD_LIBRARY_PATH=$LIBRARY_PATH; export PATH=$vh/bin:$PATH
# Above is a oneliner that sets environment variables to use the installed python in cloudfoundry
#
# It sets environment variables from the files in /home/vcap/deps/0/envs and strips the /tmp/contents... prefix from the paths
# It then sets the PATH and LD_LIBRARY_PATH
#
# Then you can run python and it will run the installed version.
View config_parse.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stuaxo
stuaxo / delete_merged.txt
Last active Nov 29, 2017
Delete merged branches
View delete_merged.txt
# Make sure the list to ignore after -v is correct
$ git branch -r --merged develop | sed 's/ origin\///' | grep -v 'master\|staging\|develop' | xargs git push origin --delete
# See also
https://makandracards.com/makandra/621-git-delete-a-branch-local-or-remote
@stuaxo
stuaxo / download_freeplane.sh
Created Nov 23, 2017
Download Freeplane mind mapper
View download_freeplane.sh
#!/bin/bash
URL="https://downloads.sourceforge.net/project/freeplane/freeplane%20preview/freeplane_bin-1.6.11-pre04.zip"
ZIP=$(basename ${URL})
DIR=$(basename ${ZIP} .zip)
set -ex
cd /tmp
You can’t perform that action at this time.