Skip to content

Instantly share code, notes, and snippets.


Fabian Keller bluenote10

  • Bosch
  • Ludwigsburg, Germany
View GitHub Profile
bluenote10 / main.dart
Last active Aug 12, 2021
Flutter: Center Positioned
View main.dart
import "package:flutter/material.dart";
void main() {
class App extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
import numpy as np
import matplotlib.pyplot as plt
from ssqueezepy import ssq_cwt, cwt
def sine(freq, num_samples=SAMPLE_RATE // 4, amp=1.0):
use std::collections::HashMap;
struct Test {
offset: f64,
buffers: HashMap<i32, Vec<f64>>,
data: Vec<f64>,
View flatmap.nim
import future
import options
proc flatMap[X](iter: iterator(): X, mapper: X -> iterator(): X): (iterator(): B) =
result = proc() =
yield X
proc iter(): int =
bluenote10 / data1.csv
Created Jan 1, 2017
Issues with d3 tip
View data1.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
bluenote10 / chantest.nim
Created Aug 30, 2015
Nim Channel Test
View chantest.nim
import os, threadpool
proc spawnBackgroundJob[T](channel: ptr Channel[T], f: iterator (): T) =
type Args = tuple[iter: iterator (): T, channel: ptr Channel[T]]
proc threadFunc(args: Args) {.thread.} =
echo "Thread is starting"
let iter = args.iter
var channel = # note: still a `ptr Channel`
View stringParseTest.nim
macro stringParseTest(s: string): stmt =
let trueString = s.strVal
let ne = parseExpr(trueString)
let ns = parseStmt(trueString)
echo treeRepr(ne)
echo treeRepr(ns)
# looking good:
# Infix
# Ident !"+"
# Ident !"y"
View nimrun
#!/usr/bin/env sh
# A wrapper around the Nim compiler to allow for easy scripting of Nim. Puts
# all temporary files in a temporary directory and cleans up after itself.
# Usage:
# - add `#!/usr/bin/env nimrun` at the beginning of your script
# - execute the nim file with it, for example, `nimrun file.nim args`
# Possible future extentions:
View notNilTest
Test = object
field: seq[int] not nil
var t: Test
echo t.field.isNil() # true
View gist:fc7907f2538606912799
import os, threadpool
proc spawnBackgroundJob[T](f: iterator (): int): TChannel[T] =
type Args = tuple[iter: iterator (): T, channel: ptr TChannel[T]]
#type Args = tuple
# iter: iterator (): T
# channel: ptr TChannel[T]
proc threadFunc(args: Args) {.thread.} =