Skip to content

Instantly share code, notes, and snippets.

strogonoff / flatten.ts
Last active April 5, 2023 02:34
Object (un)flattening in TypeScript
// Based on original implementation from Tofandel’s answer:
/* Aggregates parts (mapped to slash-separated paths) into a nested object.
{ /some/path: A, /foo: B, /some/other/path: C }
gets turned into:
{ foo: B, some: { path: A, other: { path: C } } }
strogonoff / gist:2d457d0c1681d9dedd6021e2368637c6
Last active July 2, 2020 04:10
Debug a production-packaged Electron app on macOS

In Terminal, run:

me@me:<some-app>$ ./dist/mac/<product identifier>.app/Contents/MacOS/<product identifier> --remote-debugging-port=8315
  • stdout will stream your logs and may at least give a glimpse as to where the error is thrown.
  • Open in Chrome for some useful stuff.
strogonoff /
Last active September 23, 2019 00:22
Visual differ for Metanorma flavors. Deprecated in favor of
# Deprecated
strogonoff / sparsebundle
Last active May 19, 2018 22:06 — forked from scottsb/
Create and manage a case-sensitive disk-image on macOS (OS X).
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------

Keybase proof

I hereby claim:

  • I am strogonoff on github.
  • I am strogonoff ( on keybase.
  • I have a public key ASB4AETCNWMePGNNdaKxKzRKFrpXHLFkEWeewsqDyolZCAo

To claim this, I am signing this object:

import UIKit
import PlaygroundSupport
// Original Video:
// Video:
// Video: (with zoom and fade)
// String to animate and its attributes
var string = "Hello, playground"
let attributes: [String: Any] = [
strogonoff /
Created June 13, 2014 08:53
Combine two querysets from different models in Django
import datetime
from blog.models import BlogEntry
from news.models import NewsEntry
def get_fresh_news_and_blog_entries():
u"""Returns a list containing published news entries and blog posts mixed,
sorted by publish date. Suitable for template context of, say, landing page.
news = list(NewsEntry.objects.
strogonoff /
Created March 12, 2014 07:02
Search your saved HN items
#coding: utf-8
Searches your saved HN items. Many false positives (overkill with synonyms).
$ pip install mechanize nltk
$ python username "space separated query"
strogonoff / config.js
Created August 5, 2013 20:34
AngularJS configuration module
/*jslint browser: true */
/*global _: false, angular: false */
// Configuration constants. Overrides can be specified under window.settings
(function () {
'use strict';
var SETTINGS = {
apiBaseUrl: '/',
strogonoff /
Created November 22, 2012 05:52 — forked from olasitarska/
Builds epub book out of Paul Graham's essays.
# -*- coding: utf-8 -*-
Builds epub book out of Paul Graham's essays:
Author: Ola Sitarska <>
This script requires python-epub-library:
import re, ez_epub, urllib2, genshi