Skip to content

Instantly share code, notes, and snippets.

Jonathan Mettes jmettes

Block or report user

Report or block jmettes

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
View build-closure.sh
nix-build --attr system "./nixos.nix" -o result-closure
readlink -f result-closure > closure-nix-store-path.txt
rm -r system
mkdir system
nix copy ./result-closure --to file://./system
@jmettes
jmettes / template-min.xml
Created Mar 7, 2011
Minimal/bare-bones Blogger template; used as a starting point.
View template-min.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html>
<head>
<title>
<data:blog.pageTitle/>
</title>
<b:skin><![CDATA[]]></b:skin>
</head>
<body>
@jmettes
jmettes / install-nexus.sh
Last active Jan 10, 2019
Script for installing Nexus
View install-nexus.sh
# configure HTTP proxy
export http_proxy=http://rhe-proxy.prod.lan:8080
# persistent environment variable
echo "export http_proxy=http://rhe-proxy.prod.lan:8080" > /etc/profile.d/nexus.sh
# create nexus system account
/usr/sbin/adduser -r nexus
# install nexus as per http://books.sonatype.com/nexus-book/reference/install-sect-service.html
View open-seebor.py
# http://cimss.ssec.wisc.edu/training_data/
# Record number:15,704
# Record length: 338
# Datatype: real*4
# RECORD FIELDS
# 1:101 temperature profile [K]
# 102:202 mixing ratio profile [kg/kg]
# 203:303 ozone profile [ppmv]
@jmettes
jmettes / maybe.hs
Last active Jun 26, 2017
Maybe types in haskell
View maybe.hs
-- example of a dumb function which adds one to its input, and throws exception if given 0
addOne :: Int -> Int
addOne n = case n of
0 -> error "dont add 0"
_ -> 1 + n
-- λ> 2 + (addOne 1)
-- 4
View dynamodb
import boto3
import json
from decimal import Decimal
# TIME(GPST) SAT R P1(m) P2(m) L1(cyc) L2(cyc) D1(Hz) D2(Hz) S1 S2 LLI
# 08:29:20.0 G02 1 24371639.98 24371633.08 128073906.34 99797864.41 0.0 0.0 45 32 0 0
dynamodb = boto3.resource('dynamodb', region_name='ap-southeast-2')
table = dynamodb.Table('obs')
epoch = "08:29:20.0"
View ihaskell.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View BTLE-RF24.ino
#include <SPI.h>
#include <RF24.h>
#include <BTLE.h>
RF24 radio(9,10);
BTLE btle(&radio);
char * msg = "hi";
uint8_t len = 2;
@jmettes
jmettes / file1.txt
Created Mar 10, 2011
Snippet used in an example that demonstrates file contents fetched from gists.
View file1.txt
Yo, file one!
View gist:dd965cacbac8da5d7aa5
{
"metadata": {
"name": "",
"signature": "sha256:8cc04ebd48f148f0ed91ebc8e3dc05e795fdd5af1cf19d7c087a548c117182b8"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
You can’t perform that action at this time.