Skip to content

Instantly share code, notes, and snippets.

@miraculixx
miraculixx / markup.py
Last active April 12, 2023 17:13
an extensible multi-markup reader in less than 100 lines of python code
# (c) miraculixx, licensed as by the terms of WTFPL, http://www.wtfpl.net/txt/copying/
# License: DO WHATEVER YOU WANT TO with this code.
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
from io import StringIO
from contextlib import contextmanager
@mollymerp
mollymerp / sshfs-gcp-instance-osx.md
Last active January 10, 2024 14:52
How to mount a GCP compute instance filesystem locally using `sshfs` on MacOS

How to mount a GCP compute instance filesystem locally using sshfs

This guide assumes that:

  • you already have an instance set up on GCP that you want to mount locally
  • the GCP CLI (gcloud) is installed on your local machine
  • you have authenticated locally to your google account gcloud auth login
  1. make sure your gcloud config is correct for the instance you're trying to access:
@jimmywarting
jimmywarting / readme.md
Last active April 30, 2024 21:38
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@dragisak
dragisak / DateTimeMapper.scala
Created February 11, 2013 18:17
Joda DateTime mapper in Slick
import slick.lifted.MappedTypeMapper
import java.sql.Date
import org.joda.time.DateTime
import slick.lifted.TypeMapper.DateTypeMapper
object DateTimeMapper {
implicit def date2dateTime = MappedTypeMapper.base[DateTime, Date] (
dateTime => new Date(dateTime.getMillis),
date => new DateTime(date)
@datagrok
datagrok / git-branch-simplify.md
Last active April 16, 2024 17:26
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.