Skip to content

Instantly share code, notes, and snippets.

@yorickvP
yorickvP / wl-clipboard.el
Created March 14, 2019 11:02
teach emacs to use wl-copy
(setq wl-copy-process nil)
(defun wl-copy (text)
(setq wl-copy-process (make-process :name "wl-copy"
:buffer nil
:command '("wl-copy" "-f" "-n")
:connection-type 'pipe))
(process-send-string wl-copy-process text)
(process-send-eof wl-copy-process))
(defun wl-paste ()
(if (and wl-copy-process (process-live-p wl-copy-process))
@yorickvP
yorickvP / boxblurcanvas.js
Created January 16, 2012 14:31
Fast canvas box blur
/*
BoxBlur - a fast almost Box Blur For Canvas
Edited by Yorick to make it faster in modern browsers
Version: 0.3
Author: Mario Klingemann
Contact: mario@quasimondo.com
Website: http://www.quasimondo.com/
# vim: et:sta:bs=2:sw=4:
import logging
import time
from concurrent import futures
import grpc
import sdnotify
import ctypes, socket, os
from select import select
@yorickvP
yorickvP / default.nix
Created May 24, 2020 14:43
picoscope.nix
let pkgs = import <nixpkgs> {};
in
rec {
libpicoipp = pkgs.callPackage ./libpicoipp.nix {};
picoscope = pkgs.callPackage ./picoscope.nix {
inherit libpicoipp;
mono = pkgs.mono6;
gtk-sharp-2_0 = pkgs.gtk-sharp-2_0.override { mono = pkgs.mono6; };
};
}
declare module 'datascript' {
type Db = string & {_opaque: typeof Db};
const Db: unique symbol;
type Conn = string & {_opaque: typeof Conn};
const Conn: unique symbol;
interface Iterable<T> {
next(): { value: null, done: true } | { value: T, done: false }
DeepEvaluated = int | float | str | "String" | None | dict[string, "Evaluated"] | list["Evaluated"] | Function
Evaluated = int | float | "String" | None | dict[string, "Value"] | list["Value"] | "Function"
T = TypeVar('T', bound=Evaluated)
class Value:
def __init__(self, x: Value | Evaluated | DeepEvaluated):
"""
Make a new Value from python
"""
{ stdenv, lib, fetchurl, appimageTools, electron_8, makeWrapper }:
stdenv.mkDerivation rec {
pname = "MQTT-Explorer";
version = "0.4.0-beta1";
src = appimageTools.extract {
name = pname;
src = fetchurl {
url = "https://github.com/thomasnordquist/${pname}/releases/download/0.0.0-${version}/${pname}-${version}.AppImage";
sha256 = "0x9ava13hn1nkk2kllh5ldi4b3hgmgwahk08sq48yljilgda4ppn";
@yorickvP
yorickvP / gist:3171926
Created July 24, 2012 19:05
generic C/C++ project makefile template
ifdef VERBOSE
Q =
E = @true
else
Q = @
E = @echo
endif
CFILES := $(shell find src -mindepth 1 -maxdepth 4 -name "*.c")
CXXFILES := $(shell find src -mindepth 1 -maxdepth 4 -name "*.cpp")
# nix-build -E '((import <nixpkgs> {}).callPackage ./nix/onivim2.nix {})'
{ stdenv, lib, appimageTools, requireFile, autoPatchelfHook, makeWrapper, pango, cairo, gobject-introspection, glib, epoxy, libgpgerror, gdk-pixbuf, libxkbcommon, gtk3, ncurses5, acl, xorg, libGLU }:
stdenv.mkDerivation {
name = "Oni2";
version = "0.5.9-nightly";
dontStrip = true;
buildInputs = [
autoPatchelfHook
pango
cairo
with import <nixpkgs/lib>;
let
inherit (builtins) typeOf;
cfg = import ./router-config.nix;
indent = str:
let
parts = (splitString "\n" str);
plen = length parts;
in concatStringsSep "\n"
(imap0 (i: v: if (i == 0 || i == plen - 1) then v else " ${v}") parts);