Skip to content

Instantly share code, notes, and snippets.

View MattReimer's full-sized avatar
😝
Just about done...

Matt MattReimer

😝
Just about done...
View GitHub Profile
@MattReimer
MattReimer / HSResults.xml
Last active May 17, 2017 20:00
Habitat Results
<?xml version="1.0" encoding="ISO-8859-1"?>
<log>
<habitat_version>1.4.0</habitat_version>
<rasterman_version>6.4.0</rasterman_version>
<run_timestamp>2017-05-16T23:12:41</run_timestamp>
<simulations>
<simulation type="Habitat FIS" name="FIS - ch_jv" id="1">
<sim_meta>
<meta key="species">Chinook</meta>
<meta key="watershed">Asotin</meta>
@MattReimer
MattReimer / bisectLineSearch.py
Last active January 17, 2017 23:04
I was having trouble finding the line segment at a distance "dist" along a LineString using shapely. This is what I came up with.
def bisectLineSearch(dist, line):
"""
Use a bisect approach to get the index of the start of the line segment that contains
the distance specified.
:param dist: The distance along the line
:param line: The line in question
:return: index along the line just before we encounter 'dist' length
"""
arr = list(line.coords)
@MattReimer
MattReimer / 0_reuse_code.js
Created November 22, 2016 18:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Line # Hits Time Per Hit % Time Line Contents
==============================================================
44 @profile
45 def getVolumeAndArea(arSurvey, arMinimum, fLowerElevation, fUpperElevation, fCellSize, templateRasterPath):
46
47 428 2277 5.3 0.0 assert arSurvey.size == arMinimum.size, "The two arrays are not the same size!"
48
49 428 775 1.8 0.0 if fLowerElevation is None:
50 assert fUpperElevation is not None, "An upper elevation must be provided if the lower elevation is not provided."
51 else:
/* Accessibility - hides the forward slash */
/* line 130, ../bower_components/foundation/scss/foundation/components/_breadcrumbs.scss */
[aria-label="breadcrumbs"] [aria-hidden="true"]:after {
content: "/";
}
/* line 223, ../bower_components/foundation/scss/foundation/components/_icon-bar.scss */
.icon-bar.two-up .item {
width: 50%;
}
---
vagrantfile-local:
vm:
box: puphpet/centos65-x64
box_url: puphpet/centos65-x64
hostname: somesite.site
memory: '512'
chosen_provider: virtualbox
network:
private_network: 192.168.56.101
function ai1ec_cl_get_upcoming_events( Ai1ec_Registry_Object $registry ) {
global $cleventlist;
$date_system = $registry->get( 'date.system' );
$search = $registry->get('model.search');
$local_date = $registry
->get( 'date.time', $date_system->current_time(), 'sys.default' );
@MattReimer
MattReimer / gist:c263aad4a145bf89417c
Last active August 29, 2015 14:01
AI1EC get_events_between
<?php
function some_plugin_events_get_upcoming_ids() {
//We need some helper classes from timely
global $post, $ai1ec_calendar_helper, $ai1ec_events_helper;
if (!is_object($ai1ec_events_helper)){
return;
}
@MattReimer
MattReimer / Asset.sh
Created February 24, 2014 17:04
Stupid Git tricks
# Cleaning up a problematic submodule
# ======================================
# Remove submodule foo data from .git/config
# Remove the stale submodule's gitfile rm foo/.git
# Remove the stale submodule's repo rm -rf .git/modules/foo
# Clean now: git clean -xdf
# Fun Git aliases:
$site_addr = "http://". $_SERVER['HTTP_HOST'] . "/cultch";
define('WP_HOME', $site_addr);
define('WP_SITEURL', $site_addr);