Skip to content

Instantly share code, notes, and snippets.

View livoffgrid's full-sized avatar

Olivia Moss livoffgrid

View GitHub Profile
// strings and c-strings
//
// Sample strings
//
// double mass, string seq, int K, int PTS, int M, [variable number of ints]
// 688.83 AFTDSK 1 1 0 3384 2399 1200
// 790.00 MDSSTK 1 3 1 342 2
#include <iostream>
#include <fstream>
# proteins: 249
# tryptic: 19388
# peptides: 308998
500.187 AAGEGD 0 0 0 223
500.223 SAPSTG 0 4 0 217
500.223 DGGLAS 0 1 0 161
500.223 GALGDS 0 1 0 95 77 104 195 220
500.223 SIADGG 0 1 0 61
500.223 IGGSGE 0 1 0 41
500.259 LSSAAA 0 2 0 53
@livoffgrid
livoffgrid / Ashleigh cipher
Created January 26, 2011 08:41
Simple and probably slow caesar cipher in Haskell
-- If you want to use it type something like:
-- let tmp = encode 3 "Zombies ate my brains"
-- crack tmp
helper = zip ['a'..'z'] [0..25]
let2num::Char -> Int
let2num c = head [ b | (a,b) <- helper, a==c]
num2let d = head [ a | (a,b) <- helper, b==(d `mod` length helper)]
@livoffgrid
livoffgrid / Textile-live-preview.js
Created January 30, 2011 21:58
A bunch of javascript regexes that allow for a live preview of some textile formatted text.
// This is a work in progress and does not yet support everything textile can do.
function superTextile(s) {
var r = s;
// quick tags first
qtags = [['\\*', 'strong'],
['\\?\\?', 'cite'],
['\\+', 'ins'], //fixed
['~', 'sub'],
['\\^', 'sup'], // me
@livoffgrid
livoffgrid / ruby 1.9.3 error
Created April 13, 2012 23:37
ruby 1.9.3 errors
```
boob:rails lash$ rvm install 1.9.3 --with-gcc=clang
Fetching yaml-0.1.4.tar.gz to /Users/lash/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/lash/.rvm/src
Configuring yaml in /Users/lash/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/lash/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/lash/.rvm/usr
clang: error: unsupported option '--with-libyaml'
Installing Ruby from source to: /Users/lash/.rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)...
@livoffgrid
livoffgrid / meteor_selectors.js
Created May 15, 2012 18:33
maintain selections in meteor
Template.days.travelMode = function() {
return ['DRIVING', 'BICYCLING', 'WALKING'];
}
Template.days.selected = function() {
return Session.equals('travelMode', this.toString()) ? 'selected' : '';
}
<template name='days'>
...
{{#each travelMode}}
<img id='{{this}}' class='mode {{selected}}' src='/{{this}}.png'>
@livoffgrid
livoffgrid / remove_dups.rb
Created January 24, 2013 06:10
Remove duplicates from Resque::Failure
def remove_duplicates
count = 0
trash = []
failures = Resque::Failure.all(0, -1)
failures.group_by {|f| f['payload']}.each do |k, v|
next unless v.size > 1
trash.concat v[1..-1]
end
trash.map {|f| [failures.index(f), f]}.sort!.each_with_index do |vec, i|
@livoffgrid
livoffgrid / chart.html
Last active December 20, 2015 14:39
d3 queues animation
<!DOCTYPE html>
<html>
<head> <title>d3 queues</title> </head>
<style>
text.label {
fill: black;
}
</style>
<body>
@livoffgrid
livoffgrid / gist:9356313
Created March 4, 2014 21:36
I have some formatted benchmarks going to stdout and I'd like to colorize them. Trouble is when I send a colorized string though the formatter the white space between columns gets ignored.
# Who wants to shave this yak?
# $ irb
# > require 'colorize
# > puts " %-20s %05d" % ['hello', 12]
# hello 00012
# > puts " %-20s %05d" % ['hello'.blue, 12]
# hello 00012

Greetings!

The following are some resources that have helped me as I try to figure out what it means to be a manager and a leader. This is not intended to be an exhaustive list, merely a jumping off point. A few items here may catch your eye right away, start with those ones, and follow them wherever they lead you.

Some of the resources below may not be obviously linked to management, in which case I probably included them because they helped me understand myself better. Being a manager or a leader requires an ability to understand others, but a precondition for understanding others is definitely understanding yourself.

Books