Skip to content

Instantly share code, notes, and snippets.

View regexident's full-sized avatar

Vincent Esche regexident

View GitHub Profile
@regexident
regexident / README-Template.md
Last active January 23, 2023 22:17 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Motivation

@regexident
regexident / easing.js
Created October 6, 2016 10:36 — forked from AndrewRayCode/easing.js
ES6 module-ified easing functions, based on https://gist.github.com/gre/1650294
// based on https://gist.github.com/gre/1650294
// no easing, no acceleration
export function linear( t ) {
return t;
}
// accelerating from zero velocity
export function easeInQuad( t ) {
return t * t;
@regexident
regexident / AnyDiffable.swift
Created March 17, 2017 10:26 — forked from ollieatkinson/AnyDiffable.swift
Implementation of Paul Heckel's Diff Algorithm in Swift 3
public protocol Diffable: Hashable {
var primaryKeyValue: String { get }
}
public struct AnyDiffable: Diffable {
private let _primaryKeyValue: () -> String
@regexident
regexident / tomono.sh
Created June 12, 2017 10:35 — forked from eisisig/tomono.sh
convert multiple repos to monorepo
#!/bin/bash
# Merge multiple repositories into one big monorepo. Migrates every branch in
# every subrepo to the eponymous branch in the monorepo, with all files
# (including in the history) rewritten to live under a subdirectory.
#
# To use a separate temporary directory while migrating, set the GIT_TMPDIR
# envvar.
#
# To access the individual functions instead of executing main, source this
@regexident
regexident / String+Hyphenation.swift
Created September 27, 2017 09:12 — forked from frankrausch/String+Hyphenation.swift
Returns a String with soft hyphens (U+00AD)
import Foundation
extension String {
func hyphenated(languageCode: String) -> String {
let locale = Locale(identifier: languageCode)
return self.hyphenated(locale: locale)
}
func hyphenated(locale: Locale) -> String {
@regexident
regexident / swift-responder-chain.swift
Created October 5, 2017 08:31 — forked from anandabits/swift-responder-chain.swift
A minimalist responder chain implemented in pure Swift
// Created by Matthew Johnson on 5/28/16.
// Copyright © 2016 Anandabits LLC. All rights reserved.
//
// This is a minimalist implementation of a responder chain in pure Swift.
//
// It is not intended to demonstrate the best way to
// implement event processing in Swift.
//
// The intent is to show how little code is necessary to acheive behavior
// similar to Cocoa's responder chain in pure Swift.
@regexident
regexident / swift-format.swift
Created October 27, 2017 11:06 — forked from harlanhaskins/swift-format.swift
Simple Swift Formatter using SwiftSyntax
import Foundation
import SwiftSyntax
func main() throws {
guard CommandLine.arguments.count > 1 else {
print("usage: swift-format [file]")
exit(-1)
}
let url = URL(fileURLWithPath: CommandLine.arguments[1])
@regexident
regexident / analytic_wfm.py
Created January 12, 2018 01:13 — forked from sixtenbe/analytic_wfm.py
Peak detection in Python
#!/usr/bin/python2
# Copyright (C) 2016 Sixten Bergman
# License WTFPL
#
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law.
# You can redistribute it and/or modify it under the terms of the Do What The
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See
@regexident
regexident / inherit.rs
Created January 17, 2018 11:38 — forked from kyleheadley/inherit.rs
A model for trait-based inheritance in Rust
//! Demo of static "inheritance"
//!
//! Use trait objects to get dynamic inheritance,
//! but casting to a subtype is not explored here
////////////////////////////////////////////////////////
// Define Base type, interface, and what is overloadable
////////////////////////////////////////////////////////
/// The main type that will be extended

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a