Skip to content

Instantly share code, notes, and snippets.

@alexbosworth
alexbosworth / inotify-channel-backup.md
Last active March 29, 2024 01:33
Backup channel.backup file using systemd and inotify

LND backup script for channel.backup using inotify

Install inotify

sudo apt install inotify-tools

Create script to watch for changes and copy on change

@mrocklin
mrocklin / nyc-taxi.ipynb
Last active July 6, 2023 13:55
Dask Dataframe with cuDF on a simple NYC Taxi CSV computation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Drup
Drup / sat_micro.ml
Last active June 15, 2020 17:17
SAT-MICRO, a Sat solver in 60 lines of code
(* Code extracted from:
SAT-MICRO: petit mais costaud !
by Sylvain Conchon, Johannes Kanig, Stéphane Lescuyer
*)
module type VARIABLES = sig
type t
val compare : t -> t -> int
end
@Drup
Drup / difflist.ml
Last active June 12, 2023 17:26
Difference lists and Miniformat
type ('ty,'v) t =
| Nil : ('v, 'v) t
| Cons : 'a * ('ty, 'v) t -> ('a -> 'ty, 'v) t
let cons x l = Cons (x,l)
let plus1 l = Cons ((),l)
let one x = Cons (x,Nil)
#!python
def savitzky_golay(y, window_size, order, deriv=0, rate=1):
r"""Smooth (and optionally differentiate) data with a Savitzky-Golay filter.
The Savitzky-Golay filter removes high frequency noise from data.
It has the advantage of preserving the original shape and
features of the signal better than other types of filtering
approaches, such as moving averages techniques.
Parameters
----------
y : array_like, shape (N,)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
module Main
import Data.Vect
import Data.Fin
%default total
||| If a value is neither at the head of a Vect nor in the tail of
||| that Vect, then it is not in the Vect.
notHeadNotTail : Not (x = y) -> Not (Elem x xs) -> Not (Elem x (y :: xs))
@serge-sans-paille
serge-sans-paille / functional_style.py
Created September 23, 2014 13:15
Python - functional style!
import ast
import sys
import shutil
import unparse
import unittest
import doctest
import StringIO
import os
from copy import deepcopy