Skip to content

Instantly share code, notes, and snippets.

@mpontus
mpontus / resume.json
Last active April 6, 2022 04:16
My JSON Resume
{
"basics": {
"image": "https://uploads.toptal.io/profile_photo/image/user/303253/large_daedd2f18cf8bc05a522077d18e0141c.jpg",
"name": "Michael Pontus",
"label": "Full-stack Developer",
"email": "m.pontus@gmail.com",
"location": { "city": "St. Petersburg", "countryCode": "RU" },
"profiles": [
{
"network": "GitHub",
# nodeComposition = pkgs.runCommand "node2nix" {
# src = ./.;
# buildInputs = [ pkgs.nodePackages.node2nix ];
# } ''
# mkdir -p $out
# node2nix \
# -i $src/package.json \
# -o $out/node-packages.nix \
# -c $out/default.nix \
declare function sequence<A, B>(s: { [K in keyof A]: (b: B) => A[K] }): ((b: B) => A);// [K in keyof S]: ()
const s = sequence({
typography(theme: Theme) {
return sequence({
foo() {
return theme.space[0].toString();
}
})(theme)
}
@mpontus
mpontus / toptracker.nix
Created November 19, 2021 11:50
NIX package file for TopTracker (https://www.toptal.com/tracker)
{ pkgs ? import <nixpkgs> {} }: with pkgs; let
version = "1.6.2-6524";
url = "https://d101nvfmxunqnl.cloudfront.net/desktop/builds/debian/toptracker_${version}_amd64.deb";
sha256 = "b3d234f1aa5496ca8da0c1ef1b4b58880c4f19f527b520ebbf0faab0988e9061";
deps = [
stdenv.cc.cc
glib
xorg.libX11
xorg.libXScrnSaver
gtk2
@mpontus
mpontus / themes-faces.el
Created October 24, 2021 03:44
Themes sorted by the number of faces they define
;; Themes sorted by the number of faces they define
(--each (load-theme it t t) (custom-available-themes))
(-sort (lambda (a b) (> (car a) (car b)))
(--annotate (length (get it 'theme-settings))
(custom-available-themes)))
;; Results:
;; ((1411 . solarized-dark-high-contrast)
;; (1411 . solarized-dark)
;; (1411 . solarized-gruvbox-dark)
;; (1411 . solarized-gruvbox-light)
@mpontus
mpontus / jest-async-iterator.ts
Created June 23, 2021 13:11
Custom Jest matcher for AsyncIterable contents equality
declare global {
namespace jest {
interface Matchers<R> {
toEqualAsyncIterator<T, TReturn>(expected: AsyncIterator<T, TReturn>): R;
}
}
}
expect.extend({
async toEqualAsyncIterator<T, TReturn>(
@mpontus
mpontus / launch-or-raise.sh
Created November 15, 2020 04:20
Launch an application or bring existing window to the front
#!/bin/bash
#
# Sources I found useful:
# - Messing around with WM and windows: https://askubuntu.com/a/127329
# - Command-line arguments: https://stackoverflow.com/a/29754866
#
# I also needed to run a .desktop file. So you just gonna try to
# `locate .desktop | grep -i whatever`, then link whatever you've got
# to either `{/usr{,/local},~/.local}/share/applications/`. Then you
# can run `gtk-launch emacs.desktop`, whatever.. you can omit
@mpontus
mpontus / README.md
Last active November 27, 2021 16:10
"when" conditions from VSCode's default keyboard shortcuts

Extracted by rummomg:

cat ~/.config/Code*/User/keybindings.json | \
  jq -r '.[].when|select(. != null)|split(" && ")]|flatten|unique|sort|join("\n")'

Also check out Inspect Context Keys command.

@mpontus
mpontus / literate-emacs.el
Created August 12, 2020 03:27
Emacs evaluate source block in external buffer
(define-minor-mode literate-emacs-mode
"Enable features helpful for literate init file"
nil
nil
(easy-mmode-define-keymap
`(,(cons (kbd "C-c C-c") #'literate-emacs-evaluate-externally))))
(defun org-babel-execute:emacs-lisp-external (body params)
""
(start-process "" nil "emacs" "-q" (format "--eval=(progn %s)" body)))