Skip to content

Instantly share code, notes, and snippets.

Vasilij Schneidermann wasamasa

  • Germany
Block or report user

Report or block wasamasa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wasamasa
wasamasa / checkinstance.rb
Last active Nov 14, 2019
See the local timeline of any Mastodon instance
View checkinstance.rb
#!/usr/bin/env ruby
require 'json'
require 'http'
def api_request(instance, path, params)
uri = URI::HTTPS.build(host: instance, path: path,
query: URI.encode_www_form(params))
res = HTTP.headers(accept: 'application/json').get(uri)
raise("HTTP error #{res.status.to_i}") unless res.status.ok?
View r2pipe.el
(require 'cl-lib)
(require 'json)
(defvar r2pipe-bin (executable-find "radare2"))
(defvar r2pipe-buffer "*r2pipe*")
(defun r2pipe-process-filter (proc string)
(when (buffer-live-p (process-buffer proc))
(with-current-buffer (process-buffer proc)
(let ((moving (= (point) (process-mark proc))))
@wasamasa
wasamasa / exapunks-nonograms.md
Created Oct 29, 2018
Transcription of the nonograms in the 2nd EXAPUNKS zine
View exapunks-nonograms.md

EASY

                              1  4
                           1  1  1  4
                     3  2  3  1  1  1  7  4  4
                 15  5  6  3  5  3  5  3  6  4 15

              11
            3  6
@wasamasa
wasamasa / config.scm
Last active Oct 7, 2017
Playing the piano with Kawa
View config.scm
;; ~/.config/midi.scm/config
((default-instrument-id . 4)
(default-velocity . 127)
(default-volume . 127)
(map (97 . 60) ; a -> c4
(119 . 61) ; w -> c4#
(115 . 62) ; s -> d4
(101 . 63) ; e -> d4#
(100 . 64) ; d -> e4
View alpaca.el
;;;
;;; alpaca.el -- an easy way to edit GnuPG files encrypted with
;;; shared-key cryptography
;;;
;; Author: Kazu Yamamoto <Kazu@Mew.org>
;; Created: Oct 16, 2003
;; Revised: Feb 17, 2008
;;; Commentary:
@wasamasa
wasamasa / lowdown-fenced-codeblock.scm
Created Sep 10, 2016
Fenced code block extension for lowdown
View lowdown-fenced-codeblock.scm
(module lowdown-fenced-code-block
(fenced-code-block
enable-lowdown-fenced-code-blocks!)
(import chicken scheme)
(use lowdown
lowdown-lolevel
comparse
@wasamasa
wasamasa / obfuscate-buffer.el
Last active Apr 8, 2016
Buffer obfuscation
View obfuscate-buffer.el
(defvar my-buffer-obfuscation-overlay nil)
(defun my-obfuscate-buffer ()
(interactive)
(let* ((buffer-content (buffer-substring (point-min) (point-max))))
(dotimes (i (length buffer-content))
(let ((char (aref buffer-content i)))
(when (string-match-p "[[:graph:]]" (char-to-string char))
(aset buffer-content i ?.))))
(setq my-buffer-obfuscation-overlay
@wasamasa
wasamasa / filter-buffer.el
Last active Oct 10, 2017
Emacs buffer filtering
View filter-buffer.el
(defun my-filter-current-buffer (program &rest args)
(let* ((stdout-buffer (generate-new-buffer " stdout"))
(ret (apply 'call-process-region (point-min) (point-max) program
nil (list stdout-buffer) nil args)))
(when (zerop ret)
(let ((output (with-current-buffer stdout-buffer
(buffer-string))))
(erase-buffer)
(insert output)))
(kill-buffer stdout-buffer)))
@wasamasa
wasamasa / traffic-lights.el
Created Mar 30, 2016
Finite state machine
View traffic-lights.el
(defun traffic-lights ()
(let ((state 'red))
(while t
(cond
((eq state 'red)
(message "Red")
(sleep-for 1)
(setq state 'red+yellow))
((eq state 'red+yellow)
(message "Red+Yellow")
View emacsrepl.el
;; https://github.com/antirez/linenoise
;; console_codes(4)
(defvar column-start "\e[0G")
(defvar delete-to-end "\e[0K")
(defvar retreat-cursor "\e[%sD")
(defvar advance-cursor "\e[%sC")
(defvar clear-screen "\e[H\e[2J")
(defun read-byte ()
You can’t perform that action at this time.