Skip to content

Instantly share code, notes, and snippets.

🍪
Focusing

Ben Mezger (seds) benmezger

🍪
Focusing
Block or report user

Report or block benmezger

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
View gist:cdd1649beee434e978703a82921b341b
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAADwCAYAAABxLb1rAAAgAElEQVR4Xuy9CbRld3Xe+Z073/deDSqpJEACmVlinsGAsQHH2OAhjp20HePGYCe9nJVe3e6kM7ozOk6cYSVObGIbuz00scFTIMYmYEYhkI3DLIzmoaSa6813Pufe0+v37f//1aVikISloiTqscR79d4dzj3nf77/3t/+9reLxXi9XtRN1Y2mGiqkeq5Gq8k3qZqr6La1mM+kZlONRiEVc9WF/LiibkpFSyqaUr1I3/ljFb9XLakh1Q3x0vHFD7x4/nv+ff7b8r8v/nzhnoGFJP5rpEP0gomf6zIu/YL/49d8b3o9lNORirpWWVVqNKSqnGo+m6uqFiqrUoVqzapKo8lUZVlqNptoOh5rd2dHg+1NjYa7Gg4GajWbuvTQJep0mlpZXVGjaKjdaarRLNQsGpovFmo2237dRrOpgwcO6uixU6rV0Ww0VLEY6rbbPqtv/MYXqdNuazaX6qKhVqep7Z0dPfuZT9fW1qZUtNXprKgoGqp7HR266qnSYiTVtfwBirYW45lU9NXoHU5rPi92vi+0qIZqtPb9OS4l52/vBvozXmeqcnBM7bXHSOou/Z3rM5Q03rs/62qhosVx5uv25zish+ipnNo5/7FGtFBZzr3U5nO+z72cpvNK82qmTqup+axUYy598G3/Tf3NgfZ3pKKotCik4XjsNVYUtRrNluqiqdXVNS3qUuW8UlGN1uv5ggvZVKtRqDA4cX7a6SKzbGsVXGwveP7jq6miABC5MPwt/d3Ax2ss4vlFZwn48oU0gqbnpJtkDxwforN68WUfgjOQrx3Xm5/5L117wI9VzMZY11qUlYqGNC+nqucLY2M1L7VgQc9Kzee1qkWtuUFvqul0ZkCcTqcaD4ca7GxrZ2dTg+GOpuOJDh04qAP7V9XrdaVGoU63Gxu0Fmo3W1oseN9Cdd3QykpfcxXaHVZaO3BQn/74R9WcD3Tokp
View cpu.h
void
switch_to_process(process_t *proc)
{
/* Set the entry point in MEPC */
asm volatile("csrw mepc, %0" ::"r"(proc->entrypoint));
asm volatile("mv ra, %0" ::"r"(proc->regf->ra));
asm volatile("mv sp, %0" ::"r"(proc->regf->sp));
asm volatile("mv a0, %0" ::"r"(proc));
View gist:7dd37a1e35b4d5af92be725f0efe6129
Debugger entered--Lisp error: (file-error "https://elpa.gnu.org/packages/archive-contents" "Bad Request")
signal(file-error ("https://elpa.gnu.org/packages/archive-contents" "Bad Request"))
package--download-one-archive(("gnu" . "https://elpa.gnu.org/packages/") "archive-contents" nil)
package--download-and-read-archives(nil)
package-refresh-contents()
(if (packages-installed-p) nil (message "%s" "Emacs is now refreshing its package database...") (package-refresh-contents) (message "%s" " done.") (let ((--dolist-tail-- required-packages) p) (while --dolist-tail-- (setq p (car --dolist-tail--)) (if (not (package-installed-p p)) (progn (package-install p))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
eval-buffer(#<buffer *load*-303192> nil "/Users/benmezger/.emacs.d/packages.el" nil t) ; Reading at buffer position 2086
load-with-code-conversion("/Users/benmezger/.emacs.d/packages.el" "/Users/benmezger/.emacs.d/packages.el" nil nil)
load("~/.emacs.d/packages.el")
eval-buffer(#<buffer *lo
View gist:f46ab44d806678ded83963c674e12055
Warning (initialization): An error occurred while loading ‘/Users/benmezger/.emacs.d/init.el’:
error: Package ‘undo-tree-0.6.3’ is unavailable
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.
View Makefile
PROGRAM = main
#############################################################
# Makefile Arguments
#############################################################
# BSP_DIR sets the path to the target-specific board support package.
BSP_DIR ?= $(abspath bsp)
# SRC_DIR sets the path to the program source directory
SRC_DIR ?= $(abspath kernel)
View debuuger.py
import sys
import time
import dis
import cProfile
import pstats
try:
from django.conf import settings
is_django = True
except ImportError:
View keybase.md

Keybase proof

I hereby claim:

  • I am benmezger on github.
  • I am seds (https://keybase.io/seds) on keybase.
  • I have a public key whose fingerprint is B456 B356 E3DC F1A6 1479 C936 AC7A 3084 3ADC 0D65

To claim this, I am signing this object:

@benmezger
benmezger / vim-cheatsheet.adoc
Created Feb 25, 2019
My personal Vim cheatsheet
View vim-cheatsheet.adoc

Vim Cheatsheet

Using Vim buffers

View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
View keybase.md

Keybase proof

I hereby claim:

  • I am benmezger on github.
  • I am seds (https://keybase.io/seds) on keybase.
  • I have a public key ASAYnXhxmRyWbbchDvkY9M8QDfNRZcqs-10lKXioijAjuQo

To claim this, I am signing this object:

You can’t perform that action at this time.