Skip to content

Instantly share code, notes, and snippets.

View RobBlackwell's full-sized avatar

Robert Blackwell RobBlackwell

View GitHub Profile
@RobBlackwell
RobBlackwell / configuration.nix
Last active July 19, 2021 06:27
NixOS on Dell XPS 13
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@RobBlackwell
RobBlackwell / Python Copy Blob
Created November 19, 2013 15:54
Python code to copy blobs between Windows Azure Storage accounts
#!/usr/bin/env python
import sys
import datetime
import time
from datetime import timedelta
sys.path.append('/home/reb/local/azure-sdk-for-python/')
from azure.storage import *
@RobBlackwell
RobBlackwell / Pickle.jl
Created January 31, 2018 16:23
Access pickle files in Julia
using PyCall
@pyimport pickle
function mypickle(filename, obj)
out = open(filename,"w")
pickle.dump(obj, out)
close(out)
end
function myunpickle(filename)
@RobBlackwell
RobBlackwell / arch-linux
Last active February 22, 2021 07:34 — forked from njam/arch-linux
Install Arch Linux on XPS 13 9360
# Arch installation on Dell XPS 13 (9360), October 2020
# Please also consult official documentation:
# https://wiki.archlinux.org/index.php/Installation_Guide
# https://wiki.archlinux.org/index.php/Dell_XPS_13_(9360)
# Boot from the usb.
# F12 to enter boot menu
# Set UK keymap
loadkeys uk

Keybase proof

I hereby claim:

  • I am robblackwell on github.
  • I am robblackwell (https://keybase.io/robblackwell) on keybase.
  • I have a public key ASCKTiK-mr2e19Jzs6EwX2MserBJYFoa0_EY1j7gEhXNUAo

To claim this, I am signing this object:

@RobBlackwell
RobBlackwell / Si5351_VFO.ino
Last active December 26, 2020 17:59 — forked from NT7S/Si5351_VFO.ino
A simple VFO for the Si5351 for either LCD, LCDI2C or OLED
/*
Si5351 VFO
By LA3PNA 27 March 2015
Modified by NT7S 25 April 2015
Modified to be Si5351 Arduino v2 compliant by NT7S 21 Nov 2016
Added LiquidCrystal_I2C support, M0NIL, December 2020.
@RobBlackwell
RobBlackwell / gist:5373163
Created April 12, 2013 16:12
Call the win32 API from SBCL on Windows
(ql:quickload :cffi)
(cffi:load-foreign-library "user32.dll")
(cffi:defctype hwnd :unsigned-int)
(cffi:defcfun ("MessageBoxA" message-box) :int
(wnd hwnd)
(text :string)
(caption :string)

Patch Julia

find /nix -name '*ld-linux-x86-64.so.2'
/nix/store/68sa3m89shpfaqq1b9xp5p1360vqhwx6-glibc-2.25/lib/ld-linux-x86-64.so.2

set -x the_interpreter "/nix/store/68sa3m89shpfaqq1b9xp5p1360vqhwx6-glibc-2.25/lib/ld-linux-x86-64.so.2"

patchelf --set-interpreter $the_interpreter julia
"""
column_vectors(A)
Given a two dimensional array `A` of size `m` x `n`, return an array
of `n` vectors being the columns in `A`. Each vector is of length `m`.
"""
function column_vectors(A)
m,n = size(A)
[A[:,i] for i in 1:n]
using Glob
using CSVFiles
using DataFrames
filenames = glob("*.csv")
function load_dataframes(filenames)
df = DataFrame(CSVFiles.load(filenames[1]))
for filename in filenames[2:end]
df2 = DataFrame(CSVFiles.load(filename))