Skip to content

Instantly share code, notes, and snippets.

View fsiler's full-sized avatar

Frank Siler fsiler

View GitHub Profile
@briantjacobs
briantjacobs / storytelling_from_space.md
Last active August 28, 2024 07:14
Storytelling from Space

Storytelling from Space: Tools/Resources

This list of resources is all about acquring and processing aerial imagery. It's generally broken up in three ways: how to go about this in Photoshop/GIMP, using command-line tools, or in GIS software, depending what's most comfortable to you. Often these tools can be used in conjunction with each other.

Acquiring Landsat & MODIS

Web Interface

  • Landsat archive
@karlcow
karlcow / blogpost.md
Created September 9, 2014 05:15
emlx to mbox for MacOSX. The Web site has disappeared so Here the code. http://web.archive.org/web/20130905074537/http://brownjava.org/2007/08/emlx2mboxpy.html

A week or so ago I decided I wanted to get all of my archived mail from Mac OS X's Mail.app into a more readable format. I was a bit surprised to find that ever since 10.4, Mac OS X stores its mail in an Apple-invented format called "EMLX" (well, this is what I'm calling it at least...each mail message is stored in a file that ends in ".emlx"). A very rough sketch of the file format:

  1. The first line of the file (beginning of the document to the first linefeed) is an ASCII-encoded number representing the size of the actual email message in bytes.
  2. Starting with the first byte after the linefeed is the email, exactly N bytes in size where N is the number of bytes specified in #1.
  3. From the end of the email message to the end of the .emlx file is an XML-encoded Apple PList containing metadata about the email message (presumably for spotlight).

I really don't care for the .emlx file format. The only application that's able to read it is Mail.app. Really the only reason for its existence is because Apple w

@garbados
garbados / gist:f82604ea639e0e47bf44
Created July 27, 2014 23:07
Falsehoods Programmers Believe About Gender
  1. There are two and only two genders.
  2. Okay, then there are two and only two biological genders.
  3. Gender is determined solely by biology.
  4. Okay, it’s mostly determined by biology, right?
  5. Please tell me it’s determined by DNA.
  6. Gender can be reliably determined through visual means. After all, no man would ever wear a burka.
  7. Once gender is set, it never changes.
  8. Even if the gender can change, it will only change from the one value to the other value.
  9. Only one gender can be “active” at the same time.
  10. We’re tracking gender now, so we’ve always tracked it.
// Hypergeometric JS from http://www.math.ucla.edu/~tom/distributions/Hypergeometric.html
// See <https://gist.github.com/trevnorris/c39ac96740842e05303f>
// Annotated by Adam Novak
//enter with successesAvailable<popSize/2 and sampled<popSize/2
function hyp(successesObserved, sampled, successesAvailable, popSize) {
// The actual hypergeometric CDF. Requires that half or less of the
// population be successes, and that half or less of the population be
// sampled.
@ajerneck
ajerneck / ocr.sh
Created May 20, 2014 17:57
A shell script to batch ocr image pdfs. Requires tesseract, ImageMagick, and poppler.
# Copyright Alexander Jerneck 2014
# Licensed under the MIT license (http://opensource.org/licenses/MIT)
#!/bin/bash
## Script to batch ocr pdfs, by first converting them to tifs.
echo "usage: ocr PATTERN where PATTERN is a glob matching pdf files to be converted."
echo "example: ./ocr file-20*.pdf"
for x in $@
do

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!

@sjoerdvisscher
sjoerdvisscher / liftedMonoid.hs
Last active April 7, 2020 09:41
If you have a Functor f with an instance Monoid a => Monoid (f a), f is Applicative!
{-# LANGUAGE QuantifiedConstraints, ScopedTypeVariables #-}
import Data.Monoid
-- Note: fails for instances that don't need the Monoid a or Semigroup a
pureDefault :: forall f a. (Functor f, forall a. Monoid a => Monoid (f a)) => a -> f a
pureDefault a = a <$ (mempty :: f ())
apDefault :: (Functor f, forall a. Semigroup a => Semigroup (f a)) => f (a -> b) -> f a -> f b
(defn last-non-negative [acc tuple]
(let [[_ last] acc
x (first tuple)]
(if (<= 0 x)
[x x]
[x last])))
(defbufferiterop last-non-negative-buffer [tuples-iter]
(->> (iterator-seq tuples-iter)
@thoughtpolice
thoughtpolice / CoYoOperational.hs
Last active December 17, 2017 23:46
Free (CoYoneda f) ~ Operational
{-# LANGUAGE GADTs, LambdaCase, MultiParamTypeClasses, FlexibleInstances #-}
-- |
-- Module : Control.Operational.Monad
-- Copyright : (c) Austin Seipp 2013
-- License : BSD3
--
-- Maintainer : [email protected]
-- Stability : experimental
-- Portability : unportable (GADTs, MPTCs, etc)
--
@stuartsierra
stuartsierra / sum.clj
Created June 18, 2013 17:51
Brief demonstration of JVM dead code elimination in Clojure 1.2 and 1.5
;; Demonstration of JVM dead code elimination in Clojure 1.2 and 1.5
;;
;; This Clojure script demonstrates some of the effects of dead code
;; elimination in the JVM. For unknown reasons, the bytecode produced
;; by Clojure 1.2.1 is more susceptible to elimination than the
;; bytecode produced by Clojure 1.5.1, making it seem like 1.2.1 is
;; faster. But when the code is forced to do real work, the difference
;; disappears.
;;
;; My results with Clojure 1.2.1: