Skip to content

Instantly share code, notes, and snippets.

View rasendubi's full-sized avatar
🇺🇦
wartime

Oleksii Shmalko rasendubi

🇺🇦
wartime
View GitHub Profile
(require 'cl)
(require 'el-patch)
(defvar rasen/org-roam-graph-exclude-node (lambda (id node type) nil)
"Function to exclude nodes from org-roam-graph.")
;; exclude all id nodes that are not known to org-roam (e.g., excluded)
;; (setq rasen/org-roam-graph-exclude-node
;; (lambda (id node type)
;; (and (string-equal type "id")
@rasendubi
rasendubi / default.nix
Created April 22, 2019 17:54
Nix env for rustc development
{ pkgs ? import <nixpkgs> {} }:
let
rust-etags = with pkgs; stdenv.mkDerivation {
name = "rust-etags";
src = fetchFromGitHub {
owner = "nikomatsakis";
repo = "rust-etags";
rev = "master";
sha256 = "0br2ipkcm3xdfnxn031swsvy7n6f3nwl2iklgjvrij55sf578m6j";
{
module Lexer (
Token(..),
scanTokens
) where
}
%wrapper "posn"
$digit = [0-9]
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
stdenv.mkDerivation {
name = "whatpulse-2.7.1";
src = pkgs.fetchurl {
url = http://static.whatpulse.org/files/whatpulse-linux-debian-64bit-2.7.1.tar.gz;
sha256 = "0631mnvwz5py1lp4jxdkb4sa51krljiv1w27hcrxhgqzjxba1sq7";
};
"magit-process-git-arguments" (0xfffbb600)
"apply" (0xfffbb7c8)
"progn" (0xfffbb898)
"unwind-protect" (0xfffbb978)
"save-current-buffer" (0xfffbba68)
"let" (0xfffbbbb8)
"if" (0xfffbbc88)
"magit-git-str" (0xfffbbeb8)
"apply" (0xfffbbeb0)
"magit-rev-parse-safe" (0xfffbc010)
@rasendubi
rasendubi / 01_1
Last active December 12, 2015 08:08
Adjacency Matrix
0 0 0 0 1 0 0 0 0 1
0 1 1 0 1 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0
0 0 0 0 1 0 1 1 0 0
1 1 0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 1
0 0 0 0 0 1 0 0 0 0
simpleLoops :: Graph -> [Path]
simpleLoops g = filterUniqueCycles $ concatMap (simpleLoopsFrom g) (map (:[]) $ vertices g)
simpleLoopsFrom :: Graph -> Path -> [Path]
simpleLoopsFrom g p
| isSimpleLoop p = [p]
| otherwise = concatMap (simpleLoopsFrom g) (map (:p) ov)
where
first = head p
ov = filter (not . (`elem` (init p))) $ outVertices g first
5 7
2 1
2 3
4 1
3 4
3 5
5 4
5 5