Skip to content

Instantly share code, notes, and snippets.

я котик пур-пур mvasilkov

Block or report user

Report or block mvasilkov

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
canterberry /
Created Apr 26, 2018
Export PEM-encoded EC key pair (ECDH, ECDSA)
// (Buffer is available in Node.js as a global, but we require it this way for compatibility)
// See:
const { Buffer } = require('buffer');
const crypto = require('crypto');
const keyPair = crypto.createECDH('secp256k1');
// Print the PEM-encoded private key
yossorion /
Last active Feb 17, 2020
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

manigandham /
Last active Feb 5, 2020
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

  • ProseMirror - - supports collaborative editing, offers similar options to Mobiledoc for data structure
View bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
NodeList.prototype.__proto__ = Array.prototype;
View gist:a0cf0545a2adca1d28b3
rm -rf /Volumes/ramdisk
if [[ $(mount | awk '$3 == "/Volumes/ramdisk" {print $3}') != "" ]]; then
echo /Volumes/ramdisk is mounted
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://8475854`
# coding: utf-8
# based on
import re
class AssParser:
def __init__(self):
self.dialog_re = re.compile(r'Dialogue:(?:[^,]*,){9}(.*)')
ur001 /
Created May 28, 2014
Django models decorator for tracking fields changes
def track_field_changes(only=None, exclude=()):
Django models decorator for tracking fields changes
:only: fields to track for changes (all otherwise)
:exclude: fields to exclude from tracking
Adds to model instance:
get_old_value(field_name) — old value of given field
is_changed(field_name=None) — is any field (or given field) is changed
hausen / gist:9501041
Last active Aug 29, 2015
"Fixing" xkcd 1340 (or making the most redonkulous clock ever)
View gist:9501041

"Fixing" xkcd 1340 (or making the most redonkulous clock ever)

Update: feeling adventurous? Clone or fork the xkcd clock! If you just want to see it in action or get a glimpse of how it works, keep reading.


The date in [xkcd's comic number 1340][1] [does not change][2].

# coding: utf-8
# copyright 2014 tshirtman
# distributed under the GPL licence
from __future__ import division
from import App
from kivy.lang import Builder
from import ListProperty, NumericProperty, StringProperty
from kivy.clock import Clock
View qw.sweet.js
macro makeString {
case { _ $tok } => {
return [makeValue(#{$tok}[0].token.value, #{here})]
macro qw {
rule { ($delimited ...) } => { [$(makeString $delimited) (,) ...] }
qw(space separated words) // ["space", "separated", "words"]
You can’t perform that action at this time.