Skip to content

Instantly share code, notes, and snippets.

View virtualritz's full-sized avatar
🦀
Rustacean – backend/desktop apps/2D & 3D graphics

Moritz Mœller virtualritz

🦀
Rustacean – backend/desktop apps/2D & 3D graphics
View GitHub Profile
@kevinjardine
kevinjardine / tiler.py
Created July 24, 2011 12:52
A universal tiler and polygon decompositor
# To use this, you will want to change the location of the saved data
# at least and possibly the functions called below (at the end of the file).
# You first need to install the Python Shapely library for manipulating polygons:
# http://trac.gispython.org/lab/wiki/Shapely
from math import pi, sin, cos, atan2
import shapely.geometry
import sys, copy
@gtallen1187
gtallen1187 / scar_tissue.md
Created November 1, 2015 23:53
talk given by John Ousterhout about sustaining relationships

"Scar Tissues Make Relationships Wear Out"

04/26/2103. From a lecture by Professor John Ousterhout at Stanford, class CS142.

This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.

[Laughter]

> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation

@kennwhite
kennwhite / 1944_OSS_Simple_Sabotage_Field_Manual.md
Last active November 9, 2024 03:51
1944 OSS Simple Sabotage Field Manual
@Robbepop
Robbepop / .rustfmt.toml
Created March 16, 2017 18:19
.rustfmt.toml with all configs, descriptions, parameters and defaults for version 0.7.1 of rustfmt.
# ----------------------------------------------------------------------------------
# r u s t f m t - C O N F I G
# ==================================================================================
#
# Version: 0.7.1
# Author : Robbepop <[email protected]>
#
# A predefined .rustfmt.toml file with all configuration options and their
# associated description, possible values and default values for use in other
# projects.
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active November 9, 2024 12:16
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gravitylow
gravitylow / codesign_gdb.md
Last active October 23, 2024 09:17 — forked from hlissner/codesign_gdb.md
Codesign gdb on macOS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)
//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@victor-iyi
victor-iyi / gcd.rs
Created November 8, 2020 21:42
Greatest common divisor in Rust
/// Computes the greatest common divisor of two integers using Euclid's algorithm
/// (https://en.wikipedia.org/wiki/Euclidean_algorithm).
///
/// # Example
///
/// ```rust
/// assert_eq!(gcd(3, 5), 1);
///
/// assert_eq!(gcd(2 * 3 * 5 * 11 * 17, 3 * 7 * 11 * 13 * 19), 3 * 11);
/// ```
@victor-iyi
victor-iyi / flatten.rs
Created December 13, 2020 01:34
Flatten a nested Iterator in Rust
// Author: Victor I. Afolabi
//
// Exploring Iterator Traits in Rust to implement Flatten functionality of 2D-iterators.
//
pub trait IteratorExt: Iterator {
fn flatten_ext(self) -> Flatten<Self>
where
Self: Sized + std::fmt::Debug,
Self::Item: IntoIterator,
@victor-iyi
victor-iyi / fibonacci.rs
Created December 13, 2020 01:37
Implementing the fibonacci series using Rust's Iterator
// Author: Victor I. Afolabi
// Implementing the Fibonacci series using Rust's Iterator
#[derive(Debug, PartialEq, PartialOrd)]
pub struct Fib {
current: usize,
next: usize,
}
impl Fib {