Skip to content

Instantly share code, notes, and snippets.

View jnordberg's full-sized avatar
💾
Floppy

Johan Nordberg jnordberg

💾
Floppy
View GitHub Profile
Grapefruits are funny
What is code? Please don't hurt me
Asynchronous mode
^__^
I <3 (oo)\_______
Open (__)\ )\/\
Source ||----w |
|| ||
@jnordberg
jnordberg / finishable.swift
Last active January 26, 2021 22:38
Swift Combine framework publisher that allows you to finish/cancel/close the stream based on its contents.
public struct FinishablePublisher<Upstream>: Publisher where Upstream: Publisher {
public typealias Output = Upstream.Output
public typealias Failure = Upstream.Failure
private let upstream: Upstream
private let inspector: (Output) -> Bool
init(upstream: Upstream, shouldFinish inspector: @escaping (Output) -> Bool) {
self.upstream = upstream
self.inspector = inspector
import Combine
final class ObservableOptional<Wrapped: ObservableObject>: ObservableObject {
let objectWillChange = ObservableObjectPublisher()
var value: Wrapped? {
willSet {
objectWillChange.send()
updateSubscription(newValue)
}
}

Keybase proof

I hereby claim:

  • I am jnordberg on github.
  • I am jnordberg (https://keybase.io/jnordberg) on keybase.
  • I have a public key whose fingerprint is F878 7D7B 280C 6571 59D0 AD4F E935 1214 2687 D6F1

To claim this, I am signing this object:

@jnordberg
jnordberg / _.md
Last active February 13, 2017 00:27
neural video memory usage
diff --git a/mylib/mrf.lua b/mylib/mrf.lua
index ef65bd4..0b86b91 100755
--- a/mylib/mrf.lua
+++ b/mylib/mrf.lua
@@ -149,7 +149,21 @@ function MRFMM:updateGradInput(input, gradOutput)
self.nOutputPlane = i_end - i_start + 1
-- local timer_CONV = torch.Timer()
- local temp = input.nn.SpatialConvolutionMM_updateOutput(self, input)
+ -- local temp = input.nn.SpatialConvolutionMM_updateOutput(self, input)
@jnordberg
jnordberg / data.csv
Last active August 29, 2015 14:05 — forked from anonymous/data.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
value
10.791426
7.120075
4.766859999999999
4.463623
6.0321419999999994
5.056761
6.229407
4.714748999999999
4.411493
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
value
10.791426
7.120075
4.766859999999999
4.463623
6.0321419999999994
5.056761
6.229407
4.714748999999999
4.411493