Skip to content

Instantly share code, notes, and snippets.

View tp's full-sized avatar
🏠
Working from home

Timm Preetz tp

🏠
Working from home
View GitHub Profile
@tp
tp / line-segment-intersection.ts
Last active April 18, 2024 04:04
Line Segment Intersection
// based on: https://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect
import test from 'ava';
export interface Point2D {
readonly x: number;
readonly y: number;
}
export class LineSegment {
@tp
tp / cafe-18.svg
Last active February 14, 2017 15:13 — forked from clhenrick/cafe-18.svg
Load an SVG from an external page
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tp
tp / playground.rs
Created October 7, 2016 14:46 — forked from anonymous/playground.rs
Shared via Rust Playground
// This is a bigger error exercise than the previous ones!
// You can do it!
//
// Edit the `read_and_validate` function so that it compiles and
// passes the tests... so many things could go wrong!
//
// - Reading from stdin could produce an io::Error
// - Parsing the input could produce a num::ParseIntError
// - Validating the input could produce a CreationError (defined below)
//
package main
import (
"fmt"
"time"
"appengine"
"appengine/datastore"
)
package main
import (
"encoding/base64"
"github.com/gorilla/mux"
"net/http"
"strings"
)
func main() {
@tp
tp / RightAlignedEntryElement.cs
Created March 10, 2012 18:25 — forked from dalexsoto/MojoElement.cs
RightAlignedEntryElement: A right aligned EntryElement for MonoTouch.Dialog
/// <summary>
/// A right aligned MonoTouch.Dialog EntryElement to use and build upon
///
/// @tp on github, 2012
/// </summary>
using System.Drawing;
using MonoTouch.Dialog;
using MonoTouch.Foundation;
using MonoTouch.UIKit;