Skip to content

Instantly share code, notes, and snippets.

View JonGretar's full-sized avatar

Jon Gretar Borgthorsson JonGretar

View GitHub Profile
## 4. Visualize $\theta$ (probability to observe white fish larvae) as a function of ICELAST09 when DISSAND is set to its mean value and in both cases when BOTTOMCOV=0 and BOTTOMCOV=1 (range from minimum to maximum value of ICELAST09 in the data).
```{r}
range(fishdata$ICELAST09)
```
```{r}
predict_with_bottomcoverage <- tibble(
ICELAST09 = seq(7, 21, 0.1),
DIS_SAND = mean(fishdata$DIS_SAND),
year semester teachers
2022
Spring
Björn Þorsteinsson

Plöntulífeðlisfræði

Plöntufruman, helstu frumulíffæri og skipting hlutverka. Helstu gerðir plöntuvefja. Vatnsbúskapur, helstu þættir vatnsmættis, upptaka vatns, flutningur og útgufun. Plöntunæring og upptaka næringarefna. Flutningur efna í sáldæðum. Grænukorn, ljóstillífun og ljós. Binding koldíoxíðs og myndun sykra. Öndun. Tillífun köfnunarefnis og brennisteins. Ýmsar efnaskiptaafurðir; fitur og olíur, vax og korkefni, terpenar, fenól, lignín, flavonóíðar, alkalóíðar.

Einnig að skoða [[Plöntulífeðlisfræði Próf|Eldri próf]]

@JonGretar
JonGretar / output
Created August 27, 2013 14:59
Log node.js http server response times and output it's distribution on exit.
[root@market1 ~]# ./request_time.d
Request took 275 ms to complete /users/ubf4a1949-bb12-484a-80c5-ef7d079933e8/entitlement/edf627d85-f6bc-485c-a387-65b32bf4d231/token
Request took 278 ms to complete /users/ubf4a1949-bb12-484a-80c5-ef7d079933e8/entitlement/edf627d85-f6bc-485c-a387-65b32bf4d231/token
Request took 286 ms to complete /users/u07edf558-8f50-4963-992a-728f56e49590/entitlement/e3afec1f9-ed01-4444-b7b9-6e90cf573e17/token
Request took 163 ms to complete /users/u7716cbc1-e0b9-4fab-b705-43d74aad9541/entitlement/ed89cf626-28c3-48ee-84d0-964726a9caef/token
Request took 1 ms to complete /organization/oz/catchup/content/26cf243fda948f68430942993257746b
Request took 3 ms to complete /organization/oz/catchup/content/26cf243fda948f68430942993257746b
Request took 0 ms to complete /organization/oz/catchup/content/a61d78c15d3aecf8982e097ff8f74d2f
Request took 2 ms to complete /organization/oz/catchup/content/a61d78c15d3aecf8982e097ff8f74d2f
Request took 3 ms to complete /organization/oz/catchup/content/a
@JonGretar
JonGretar / ipcalc.erl
Created March 14, 2012 16:35
Module for calculating network address.
-module(ipcalc).
-author('Jon Gretar Borgthorsson <jongretar@medizza.com>').
-export([
get_network/2
]).
%% When Netmask is not Integer
get_network(_NetworkAddress, Netmask) when is_list(Netmask) ->
throw(netmask_not_integer);

Instrument Anything in Rails 3

With Rails 3.0 released a few weeks ago I've migrated a few apps and I'm constantly finding useful new improvements. One such improvement is the ability to log anything in the same way that Rails internally logs ActiveRecord and ActionView. By default Rails 3 logs look slightly spiffier than those produced by Rails 2.3: (notice the second line has been cleaned up)

Started GET "/" for 127.0.0.1 at Mon Sep 06 01:07:11 -0400 2010
  Processing by HomeController#index as HTML
  User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1
  CACHE (0.0ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1

Rendered layouts/_nav.html.erb (363.4ms)

/*
* Copyright 2009 agile42 GmbH - All rights reserved
*
* Authors:
* - Martin Häcker <martin.haecker@agile42.com>
*/
// TODO: minimize this so only the actual dependencies are included
@import <AppKit/AppKit.j>
@implementation CalendarView: CPView
{
}
-(id)init {
self = [super initWithFrame:CGRectMake(0, 0, 200, 200)];
if (self) {
[self loadData];
}
@JonGretar
JonGretar / ssh_install_key
Created January 27, 2009 11:41
Uploads your ssh key to a host
#!/bin/sh
# USE: ssh_install_key username@some.host.com
KEY="$HOME/.ssh/id_rsa.pub"
if [ ! -f ~/.ssh/id_rsa.pub ];then
echo "private key not found at $KEY"
echo "* please create it with "ssh-keygen -t dsa" *"
echo "* to login to the remote host without a password, don't give the key you create with ssh-keygen a password! *"
exit
@JonGretar
JonGretar / stream-json-bufferize.js
Created January 20, 2015 02:16
Bufferize support for stream-json
'use strict';
var util = require("util");
var Transform = require("stream").Transform;
function Bufferize(options){
Transform.call(this, options);
this._writableState.objectMode = true;
this._readableState.objectMode = false;
this._firstItem = true;
@JonGretar
JonGretar / keybase.md
Created August 15, 2014 00:07
keybase.md

Keybase proof

I hereby claim:

  • I am JonGretar on github.
  • I am jongretar (https://keybase.io/jongretar) on keybase.
  • I have a public key whose fingerprint is A25C E494 708E 603A 7A8E 0F34 32FC 10A9 E2D4 4D0F

To claim this, I am signing this object: