Skip to content

Instantly share code, notes, and snippets.

View lukecampbell's full-sized avatar

Luke Campbell lukecampbell

View GitHub Profile
@lukecampbell
lukecampbell / table.md
Last active December 17, 2015 11:19
Parameters

Begin

                  name                      |   dp_id    | combine_qc_flags |   polyval_qc   | glblrng_qc |   gradtst_qc   |   loclrng_qc   |   modulus_qc   |   solarel_qc   | spketst_qc | stuckvl_qc |   trndtst_qc

------------------------------------------------|------------|------------------|----------------|------------|----------------|----------------|----------------|----------------|------------|------------|---------------- Density | DENSITY_L2 | not applicable | not applicable | applicable | applicable | applicable | not applicable | not applicable | applicable | applicable | not applicable Flux of CO2 from the Ocean into the Atmosphere | CO2FLUX_L2 | not applicable | not applicable | applicable | not applicable | not applicable | not applicable | not applicable | applicable | applicable | not applicable Mean Point Water Velocity | VELPTMN_L1 | not applicable | applicable | applicable | not applicable | appl

@lukecampbell
lukecampbell / assessment.md
Last active December 8, 2016 15:59
HDF Corruption Assessment

HDF Corruption

CI engineers observed an issue with attempting to retrieve data from a PREST raw data product. The dataset 8f13001a08a14162abfcc0288840f491 comprises a ViewCoverage, a ComplexCoverage and several SimplexCoverages. Each SimplexCoverage comprises several HDF5 files, each file contains a time-series dataset for a specific parameter. The ComplexCoverage combines the SimplexCoverages and provides a seamless API that aggregates the data over a universal time axis. The ViewCoverage provides a filtered view of the data, in this case all of the data is presented so it is a transparent API that delegates all calls to the ComplexCoverage. When the dataset was queried by PyDAP an exception was raised and logged. Initial investigation led to the conclusion that the data file for the data product was

@lukecampbell
lukecampbell / github.rb
Created October 4, 2013 18:25
github.rb A Ruby script to make dealing with github easier and from the command line
#!/usr/bin/env ruby
#
require 'slop'
require 'git'
class GitHub
def initialize(remote=nil, branch=nil, url='https://github.com/')
if File.directory? '.git'
@g = Git.open('./')
@lukecampbell
lukecampbell / supervisord.conf
Created October 16, 2013 19:43
supervisord
; Sample supervisor config file.
;
; For more information on the config file, please see:
; http://supervisord.org/configuration.html
;
; Note: shell expansion ("~" or "$HOME") is not supported. Environment
; variables can be expanded using this syntax: "%(ENV_HOME)s".
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
@lukecampbell
lukecampbell / logging.local.yml
Created October 16, 2013 20:55
logging.yml
root:
level: INFO
formatters:
minimal:
format: '%(message)s'
handlers:
dotfile:
class: logging.handlers.RotatingFileHandler
formatter: minimal
@lukecampbell
lukecampbell / breakpoint.py
Last active December 30, 2015 01:59
breakpoint
def breakpoint(scope=None, global_scope=None):
import traceback
from IPython.config.loader import Config
ipy_config = Config()
ipy_config.PromptManager.in_template = '><> '
ipy_config.PromptManager.in2_template = '... '
ipy_config.PromptManager.out_template = '--> '
ipy_config.InteractiveShellEmbed.confirm_exit = False
@cerivera
cerivera / foreach vs for loop
Last active April 6, 2017 14:14
Underscore.js foreach vs native for loop speed test
// Build 100000 alphabet dictionaries
var dict = {};
for (var i = 0; i < 100000; i++) {
dict[i] = {};
for (var c = 65; c < 65+26; c++) {
dict[i][String.fromCharCode(c)] = c;
}
}
// Loop through parent and child dictionaries in native JS
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 10, 2025 09:21
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

#!/usr/bin/env python
'''
@author Luke Campbell
@file ion/util/h5_graph.py
'''
from struct import unpack
from StringIO import StringIO
import os
@tkafka
tkafka / LICENSE.txt
Last active May 17, 2024 02:08
Drop-in replacement for ReactCSSTransitionGroup that uses velocity.js instead of CSS transforms. Add your own transitions to `transitions` hash.
The MIT License (MIT)
Copyright (c) 2014 Tomas Kafka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: