Skip to content

Instantly share code, notes, and snippets.

View semafor's full-sized avatar

Jonas Groenaas Drange semafor

  • Webstep ASA
  • Bergen, Norway
View GitHub Profile
// assumes intervals to be sorted on Start then End
highWaterMark := epoch
sum := 0
for interval := intervals
if interval.End.Before(highWaterMark) continue
sum += between(
max(highWaterMark, interval.Start),
max(highWaterMark, interval.End)
)
highWaterMark = interval.End
  • Sånn tynn sekk man kan løpe med, ha ekstra sko og klær i.
  • Ny hodelykt.
  • Ny klokke.
    • Fitbit surge (2200,-)
    • Eller en annen. Helst innebygget pulsmåler, og en eller annen form for pairing (bluetooth) med mobil.
  • Terrengsko med god demping.
  • Inov 8 (1650,-)
<html>
<head>
<style>
.meta { display: none; }
</style>
</head>
<body
vocab="http://schema.org/"
typeOf="CreativeWork"
{
"folders":
[
{
"path": "wd",
},
{
"path": "build-local"
}
],
group: medical
DOCTOR = {
Name:string, Doctorssn:number, Location:string
"Dr. Donnatella Moss", 601,"Stockholm, Sweden"
"Dr. Bruno Gianelli", 603,"Stalingrad, Russia"
"Dr. Rose Landingham", 604,"Frankfurt, Germany"
"Dr. Toby Ziegler", 605,"Bergen, Norway"
"Dr. Toby Ziegler", 605,"Bodø, Norway"
"Dr. E. Livden", 607,"København, Denmark"
@semafor
semafor / info125-oblig2-sql.sql
Last active October 22, 2015 18:23
INFO125: Obligatory assignment 2–SQL
create database healthcare;
/* In PostgreSQL, we connect to it using the \connect healthcare; command */
create table Doctor (
Name VARCHAR(20) NOT NULL,
Doctorssn INT PRIMARY KEY NOT NULL,
Location VARCHAR
);
create database healthcare;
\connect healthcare;
create table Doctor (
Name VARCHAR(20) NOT NULL,
Doctorssn INT PRIMARY KEY NOT NULL,
Location VARCHAR
);
@semafor
semafor / .css
Last active October 5, 2015 07:56
.card:before {
content: "Silo n";
display: block;
border-bottom: 1px solid #ccc;
background-color: antiquewhite;
padding: 0.5em;
text-align: center;
}
# Find the context that you want to remove.
# Note: ril_0 is the first sim slot, ril_1 is the second. We'll be using the first.
gdbus call --system -d org.ofono -o /ril_0 -m org.ofono.ConnectionManager.GetContexts | tr ',' '\n'
# Outputs:
#([(objectpath '/ril_0/context2'
# {'Name': <'Bad MMS APN'>
# 'Active': <false>
# 'Type': <'mms'>
# 'Protocol': <'ip'>
@semafor
semafor / gist:45f8edb307e69566a7c9
Created March 19, 2015 16:27
NetworkManager gdbus introspection
Find ActiveConnections
$ gdbus call -y -d org.freedesktop.NetworkManager -o /org/freedesktop/NetworkManager -m org.freedesktop.DBus.Properties.Get "org.freedesktop.NetworkManager" "ActiveConnections"
Find Connection that the ActiveConnection points to
$ gdbus introspect -y -d org.freedesktop.NetworkManager -o /org/freedesktop/NetworkManager/ActiveConnection/0
Look at the Connection
$ gdbus introspect -y -d org.freedesktop.NetworkManager -o /org/freedesktop/NetworkManager/Settings/1
Deactivate the ActiveConnection