Skip to content

Instantly share code, notes, and snippets.

View bmorphism's full-sized avatar
🦍
annealing information lattice since *2069*

Barton Rhodes bmorphism

🦍
annealing information lattice since *2069*
View GitHub Profile
@bmorphism
bmorphism / emacs-term.el
Last active August 29, 2015 14:04
Making multi-term behave
(add-hook 'term-mode-hook
(lambda () (setq truncate-lines t)))
(eval-after-load "multi-term"
'(progn
(add-to-list 'term-bind-key-alist '("C-c C-j" . term-line-mode))
(add-to-list 'term-bind-key-alist '("M-DEL" . term-send-backward-kill-word))
(add-to-list 'term-bind-key-alist '("M-h" . term-send-backward-kill-word))
(add-to-list 'term-bind-key-alist '("C-h" . term-send-backspace))
))
@bmorphism
bmorphism / problem60
Created February 21, 2015 02:01
My solution to 4Clojure problem 60
(fn fun-times
([fun xs] (fun-times fun (first xs) (rest xs)))
([fun init xs] (lazy-seq
(if (seq xs)
(let [reduction (fun init (first xs))]
(cons init (fun-times fun reduction (rest xs))))
[init]
))))
@bmorphism
bmorphism / totient
Created March 27, 2015 01:41
Euler's totient function
(defn totient [num]
(if (= 1 num) 1
(let [gcd (fn [a b]
(if (= b 0)
a
(recur b (rem a b))))]
(count (filter #(= 1 (gcd % num)) (range 1 num))))))
### Keybase proof
I hereby claim:
* I am bmorphism on github.
* I am bmorphism (https://keybase.io/bmorphism) on keybase.
* I have a public key ASDkNkLrJjJ8RjMjYZBWog7OAR5-rk-AM9bM0tbP1Vmycgo
To claim this, I am signing this object:
@bmorphism
bmorphism / move_document.py
Created July 7, 2021 19:19
Exhibit A: Reveries from our classist past
class Document:
def __init__(self, source_doc, dest_doc):
'''Instantiate the document object with Google Docs id and Destination Name'''
self.source_doc = source_doc
self.dest_doc = dest_doc
self.content = [""]
self.processed = ""
def get_document(self):
'''
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"annotations": {
"kubernetes.io/psp": "eks.privileged"
},
"creationTimestamp": "2021-10-11T23:33:51Z",
"labels": {
"run": "interview-example"
@bmorphism
bmorphism / erc20-copilot.log
Created October 29, 2021 15:34
what_could_possibly_go_wrong
Synthesizing 10/10 solutions
=======
) internal virtual {
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: insufficient balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] = _balances[recipient] + amount;
@bmorphism
bmorphism / hello-matrix.go
Last active April 14, 2022 22:57
hello-matrix.go
// Copyright 2077 securityDAO
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDXB6r75qnPnsjQZmxV0g0zl1stJNfOYwKTEU3KOn6WwIjI1P99KO+BDavLjVNgvOaL2BNh7b+OcKvf4lkDIyGmQp61ozDpS5m7irvbnm0bm08oeVv7quggv7D65RJiGZYw/QEvM0va4zadYk9CvQ6KWQB++C1CT7azmhnqqvfJI2yd70sdNvf0dc+OmNncXQ+gl2/zg/1Q4XmdQ/hPB0dr5fTuor8j+ZTUV1I2tSa8Ar+pDO3yuzssdlUsE6Zk01WkdiAfyTuvsII9tFN1tM74ygbhLKE3f0c3ijaQLYSHHoSPtqeQjxY7ebN5R59WSrlKFFfxQW+RWnDtGAcuzhv5uXakcf9RnsDUqdeyuU1DU9D0XZwXI9Yo8zMLL7Aoo5KSTs5MISJ5GpZpFXrlUmj8XK1wUYg47ZM01jnvbIxiZYh+Iv4EdkBvGqnbEiXOmhJ7MsU+nG/g2bYUvQ5oueCBGpkW2G+hokbwJsHFDftrTaBXzN6z9WOcHkQIQbsB/pM= barton@binah
@bmorphism
bmorphism / translation.json
Last active July 21, 2022 12:45
packages/i18n/locales/ua
{
"button": {
"acceptTerms": "Я погоджуюсь з Правилами проекту",
"addAnAction": "Додати Дію",
"addMember": "Додати Осіб",
"addPayment": "Додати Платіж",
"addTier": "Додати Курінь",
"addToKeplr": "Додати Акцію до Гаманця",
"back": "Назад",
"castYourVote": "Проголосувати",