Skip to content

Instantly share code, notes, and snippets.

View ColdDevil's full-sized avatar

Florian Blum ColdDevil

View GitHub Profile
@kristopherjohnson
kristopherjohnson / LowPassFilterSignal.swift
Last active April 2, 2023 00:54
Simple implementation of low-pass filter
struct LowPassFilterSignal {
/// Current signal value
var value: Double
/// A scaling factor in the range 0.0..<1.0 that determines
/// how resistant the value is to change
let filterFactor: Double
/// Update the value, using filterFactor to attenuate changes
mutating func update(newValue: Double) {
@licvido
licvido / app.swift
Created February 3, 2015 23:18
SWIFT: Fade when changing UIImageView's image
let toImage = UIImage(named:"image.png")
UIView.transitionWithView(self.imageView,
duration:5,
options: .TransitionCrossDissolve,
animations: { self.imageView.image = toImage },
completion: nil)
@alexras
alexras / breaks.tex
Created September 23, 2012 01:46
Fix URL breaks in LaTeX
% Allow breaking at both hyphens and spaces
\usepackage[hyphens,spaces]{url}
% A sequence of BigBreaks will be treated as one break, so it will only be able to break after ://
\renewcommand{\UrlBigBreaks}{\do\:\do\/}
% (Less aggressive) Treat both / and - as breakable characters (don't know why this does something different than hyphens in the package declaration, but it does)
\renewcommand{\UrlBreaks}{\do\/\do\-}
% (More aggressive) Any letter and / are treated as breakable characters
@nschneid
nschneid / zotselect-link.js
Last active January 15, 2024 02:56
Zotero export translator that generates a zotero://select link to an item in the Zotero library. (First a simple version, as well as a version that displays minimal citation information and stores further details as title text.)