Skip to content

Instantly share code, notes, and snippets.

@flyinghyrax
flyinghyrax / geol105-p1.md
Last active August 29, 2015 14:07
Some note for Geology 105 test 1

Combined, undated notes for Part I - Rocks and Minerals

Some Intro

Philosophies in Geology

  1. Scientific method of analysis - ideally, unbiased (but in practice this is impossible). Basic steps:
    1. Observe relative to the question or problem
    2. Hypothesize based on observations
  2. Test hypothesis
@flyinghyrax
flyinghyrax / assoc_meta.json
Created November 30, 2014 02:14
Determining one-way associations between categorical attributes in CFPB data
[
{
"name": "Issues by product",
"key_col": "Product",
"val_col": "Issue"
},
{
"name": "Products by issue",
"key_col": "Issue",
"val_col": "Product"
@flyinghyrax
flyinghyrax / terminalcolors.py
Created December 19, 2014 03:02
Cleaned up version of random terminal color test script from the interwebz
#!/usr/bin/env python
# Copyright (C) 2006 by Johannes Zellner, <johannes@zellner.org>
# modified by mac@calmar.ws to fit my output needs
# modified by crncosta@carloscosta.org to fit my output needs
# modified by theflyinghyrax@gmail.com (2014)
# - use if __name__ == "__main__" to run script stand-alone
# - organize and define more reusable functions (could be more idiomatic)
import sys
--[[
Add a table like this to the script, near the beginning of the file.
The numbers on the left are the max temps for the strings on the right;
i.e. if the temperature is between 0 and 20 degrees then the phrase is
"You need a big coat". These numbers are just examples and are for
Fahrenheit temperatures; they should be changed for your preferences and
to reasonable Celsius values if you use Celsius temps
]]
local Main_String_Options = {
100 = "You need a bathing suit",
@flyinghyrax
flyinghyrax / osx_annoyances.md
Last active August 29, 2015 14:21
OS X annoyances draft

OS X Annoyances

Little things that bother me when using OS X

Don't get me wrong, there are a lot of things to like about OS X (there's a section with just a few of my favorite things at the bottom), but I've become acutely disillusioned with OS X's veneer of perfection. It seems to me that one of the main things that Apple accomplished with OS X was to create and maintain a thriving ecosystem of third-party applications specifically designed to fix the shortcomings of the operating system.

Mind, I'm also an OS X newbie. I'm sure that there are apps or console commands or buried settings that fix a lot of these gripes. But that also sort of proves my point - because many of these are things that ought to be incredibly simple, or easy to tweak, or have a better default; but they aren't, or don't. These have been the pain points for me as a relatively experienced Windows and Linux desktop user trying to get used to OS X.

Finder

@flyinghyrax
flyinghyrax / PolymorphicSessions.swift
Created August 12, 2015 20:54
Idea for implementing session structure in a way that supports polymorphism
/*
It won't work, b/c doing the JSON parsing will be a unbelievable pain!
The "snazziness" of this solution isn't worth that pain and the time it takes to implement,
considering how much we would use it.
*/
// MARK: Session type protocols
protocol Session {
// session id, unique to the user
@flyinghyrax
flyinghyrax / EventuallyIndex.swift
Created August 13, 2015 15:48
Started indexing code and never finished
import Foundation
// helper protocols for adding things to the index
protocol Identifiable {
var id: Int { get }
}
protocol Tagged {
var tags: Set<Tag> { get }
@flyinghyrax
flyinghyrax / observation.swift
Last active August 29, 2015 14:27
Copy into a playground and open the debug area with Cmd+Shift+Y to see output
import Foundation
/*
Demonstrates creating and avoiding retention cycles in callbacks
*/
/* UTILITIES */
/// Wraps a something in a class
class Box<T> {
@flyinghyrax
flyinghyrax / step_buckets.log
Created November 12, 2015 18:04
Step Count 30-day daily aggregate log output
: Connected!!!
: Found 31 buckets
: Bucket: 2015-10-13 00:00 - 2015-10-14 00:00
: Data Sets:
: Data returned for Data type: com.google.step_count.delta
: Bucket: 2015-10-14 00:00 - 2015-10-15 00:00
: Data Sets:
: Data returned for Data type: com.google.step_count.delta
: Bucket: 2015-10-15 00:00 - 2015-10-16 00:00
: Data Sets:
@flyinghyrax
flyinghyrax / Spiral.hs
Created February 17, 2016 17:13
It draws an ASCII spiral
module Spiral where
import System.Environment
import qualified Data.List as List
import qualified Data.Set as Set
{- Process outline:
- 1. Create infinite sequence of points on the spiral
- 2. Take a finite subsequence
- 3. Shift all the points so the origin is in the top left