Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@defclass
defclass / git-auto-push.sh
Last active February 16, 2024 02:45
auto push to Github when files change
#!/bin/bash
## Tested on macOS big sur 11.2.1
## Usage:
## git-auto ;; use current script dir as git dir, and auto commit, not push.
## git-auto -d /path/to/your/note's/dir ;; set git dir
## git-auto -p ;; auto commit and push
## git-auto -s origin -p ;; set remote server
## git-auto -b main -p ;; set git branch
## git-auto -i 30 -p ;; set interval seconds
@defclass
defclass / jd.md
Last active March 1, 2023 08:44
开源笔记 Logseq 远程团队招聘两位开发工程师 [已结束]

开源笔记 Logseq 远程团队招聘两位开发工程师 [已结束]

v2ex帖子地址

cnodejs帖子地址

工作时间,方式,内容与待遇

  • 全员远程,WFH,WLB。
@SlyBouhafs
SlyBouhafs / dracula-beta-theme.css
Last active March 20, 2021 18:16
Dracula Beta Logseq Custom Theme
:root {
--background: #282a36;
--light-background: #343746;
--lighter-background: #424450;
--dark-background: #21222c;
--darker-background: #191a21;
--foreground: #f8f8f2;
--current-line: #44475a;
--comment: #6272a4;
--white: var(--foreground);
@nikdoof
nikdoof / Memex -> Logseq
Last active September 30, 2023 00:55
A copy template for Memex that'll paste nicely into Markdown mode LogSeq
[{{{title}}}]({{{url}}}) #Article
### **Summary**
{{#Notes}}
#### {{{NoteText}}}
{{/Notes}}
### **Highlights**
{{#Notes}}
#### {{{NoteHighlight}}}
{{/Notes}}
@Khady
Khady / ppxed-source
Created September 9, 2019 06:46
Use merlin to print an ocaml file after being processed by a ppx
#!/usr/bin/env sh
# A .merlin must be present nearby the file.
# With dune it can be generated by calling `dune build @check`.
FILE="$1"
ocamlmerlin single dump -what ppxed-source -filename "$FILE" < "$FILE" | jq -r '.value' | ocamlformat --name="$FILE" -
theory
Consensus_Demo
imports
Network
begin
datatype 'val msg
= Propose 'val
| Accept 'val
@cldwalker
cldwalker / knowledge-graph-experiment.md
Last active March 11, 2024 11:10
knowledge graph experiment

I like to learn, index and retrieve information a lot. I know a lot of others do as well. We share data but I don't think we share our information and rarely our ontologies (a.k.a. our mental models). If we shared our ontologies, I think we could learn more from each other. With this hope in mind, I'm looking for a tool that provides these features:

  • Shares my ontology publicly
  • Shares my bookmarks publicly
  • Provides easy entry, extension and querying of my ontology
  • Provides easy entry and querying of my bookmarks
  • Shares interesting snapshots of my bookmarks
  • Encourages discovery of information that is new and interesting to others

Since I have not found such a tool, I have built a tool that:

@megayu
megayu / IDObfuscation.java
Last active March 4, 2022 10:54
an id obfuscation algorithm to generate a string of length 25
public class IDObfuscation {
private static final char[] ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".toCharArray();
private static final int BASE = ALPHABET.length;
private static final byte[] PADDING = {0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17};
private static final byte NEGATIVE = 0x2A;
private int key;
public IDObfuscation(int key) {
this.key = key;
}
{:deps
{org.clojure/clojure {:mvn/version "1.9.0"}
com.datomic/datomic-free {:mvn/version "0.9.5697"}}}
@roman01la
roman01la / specs.clj
Created March 22, 2018 21:56
Figma File API specs
(ns figma.specs
(:require [clojure.spec.alpha :as s]))
(def color-chan
(s/and number? #(<= 0 % 1)))
(def alpha-chan
(s/and number? #(<= 0 % 1)))
;;=============================================