Skip to content

Instantly share code, notes, and snippets.

View fowlmouth's full-sized avatar
🦃

Tim E fowlmouth

🦃
  • United States of America
View GitHub Profile
@fowlmouth
fowlmouth / git-crypt.md
Created June 20, 2023 13:50 — forked from davidread/git-crypt.md
git-crypt + GPG guide

git-crypt guidance

Some repositories have git-crypt enabled, which encrypts certain files. This doc describes how to add and remove users, using their GPG keys, and has associated scripts. (You can also just share the repo's symmetric key, which is simpler, but not covered here.)

Understanding git-crypt

A repo that has been git-crypt'd should have in its repo:

  • .gitattributes - defines which files should be encrypted
  • .git-crypt/keys/default/0/*.gpg - .gpg file for every user (Each .gpg file is the repo's symmetric encryption key, which has been encrypted for a particular user with their individual public key. The filename is the user key's fingerprint.)
import macros
macro mac(n: expr): expr =
return quote do:
(proc(): int =
`n`.int)
template samething(n): expr =
(proc (): int = n.int)
import jester, asyncdispatch, htmlgen
proc foo(s:string):string = return s&"!"
when isMainModule:
let d:string="asdf"
routes: get "/": resp foo(d) # self.render_movie(self.latest_movie_id)
runForever()
type MyObj = ref object of RootObj
method output(self: MyObj) =
echo "Output something"
type ChildObj = ref object of MyObj
customvar: string
method newOutput(self: ChildObj) =
self.customvar = "Child output custom var too"

Box drawing fun

A few boxes drawn with Unicode box drawing characters:

╔═╦═╗
╠═╬═╣
║ ║ ║
╚═╩═╝
@fowlmouth
fowlmouth / lc.nim
Last active August 29, 2015 14:12 — forked from def-/lc.nim
template ctime: expr =
var result: seq[int]
for a in 1..10:
for v in 1..10:
result.add a+v
result
const foo = ctime()
echo foo
#![feature(macro_rules)]
extern crate collections;
extern crate sync;
use std::sync::{Arc, Mutex, RWLock, RWLockReadGuard};
use std::sync::atomic::{AtomicBool, AtomicPtr, AtomicUint, Ordering, Relaxed, SeqCst};
use std::ptr;
use std::ptr::{RawMutPtr};
use std::slice::Items;