Skip to content

Instantly share code, notes, and snippets.

View kiranandcode's full-sized avatar
💭
thinking really hard

Kiran Gopinathan kiranandcode

💭
thinking really hard
View GitHub Profile
@kiranandcode
kiranandcode / cram-mode.el
Created January 22, 2023 13:37
An emacs mode for cram tests
;;; cram-mode.el --- Emacs mode for CRAM tests -*- lexical-binding: t; -*-
;; Copyright (C) 2023 Kiran Gopinathan
;; Author: Kiran Gopinathan
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@kiranandcode
kiranandcode / property.rs
Created August 8, 2018 13:27
Example Implementation of additive changes in rust - needs polishing
use std::ops::{Add, AddAssign, Sub};
pub trait Lerpable<T> {
fn at_progress(&self, progress: f32) -> T;
}
pub trait Diffable<T, U : Lerpable<T>> {
fn diff(start: &T, end: &T) -> U;
}
pub struct AddativeDiff<T, U : Lerpable<T>> {
@kiranandcode
kiranandcode / dependent_view_drops_called.rs
Created August 4, 2018 00:43
A quick test demonstrating how the dependent view ensures that all items are still dropped as expected.
#[macro_use] extern crate dependent_view;
use std::rc::{Weak, Rc};
use dependent_view::rc::DependentRc;
trait Testable {
fn get_id(&self) -> usize;
fn get_i_id(&self) -> usize;
}
class DataSet {
String dateStrings[] = new String[350];
Float precipitationValues[] = new Float[350];
DataSet() {
dateStrings[0] = "21/03/1948";
precipitationValues[0] = 2.04;
dateStrings[1] = "26/09/1948";
precipitationValues[1] = 1.51;
dateStrings[2] = "16/02/1949";
precipitationValues[2] = 1.83;