Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Floering hangtwenty

View GitHub Profile
@hangtwenty
hangtwenty / myweechat.md
Created May 12, 2020 — forked from pascalpoitras/myweechat.md
My always up-to-date WeeChat configuration (weechat-dev)
View myweechat.md

WeeChat Screenshot

You need at least WeeChat 2.8-dev

Enable mouse

/mouse enable
@hangtwenty
hangtwenty / vscode fix command not found: nmake.md
Last active Apr 16, 2020
zsh:1: command not found: nmake
View vscode fix command not found: nmake.md

Here's one of the many small snags one might encounter when trying out VS Code for the first time (on a Mac).

This one is super trivial to "fix" but searching the error didn't bring up much, hoping it may help someone if I post it here and a search engine indexes it.

Error message

  1. You attempt to do make build or something like that, run from VS Code.
  2. You see this:
View postgrest_docs_snippet.rst

What is the HTTP header application/vnd.pgrst.object+json?

  • It tells Postgrest that only a single object is expect, rather than an array of objects.
  • You can include this header when needed. If you need an array of results, omit the header.

Here's more info from the official postgrest docs:

https://github.com/PostgREST/postgrest-docs/blob/v6.0/api.rst

@hangtwenty
hangtwenty / fix_typo_for_django_cached_template_loader.md
Last active Dec 5, 2019
TypeError: __init__() missing 1 required positional argument: 'loaders'
View fix_typo_for_django_cached_template_loader.md

Django's Cached Template Loader

Quick tip on fixing an error that may confuse you. Namely, because in the settings file, we have to give string names - so errors are somewhat abstracted from your input.

Basically, when you give the argument to TEMPLATES["OPTIONS"]["loaders"],

  • the argument is a list of loaders;
  • for the cached loader, the first argument is the cached loader,
  • but it needs 1+ args - what it's caching.
  • You pass this as a tuple of the loader, and its args.
@hangtwenty
hangtwenty / README.md
Last active Nov 6, 2019
Quick note - how to fix django-livereload-server import error. https://github.com/tjwalch/django-livereload-server
View README.md

Error:

ImportError: cannot import name 'livereload_port' from 'livereload'

Cause:

You have both livereload and django-livereload-server installed. Most likely, one was installed before the other, and having both is an accident.

@hangtwenty
hangtwenty / README.md
Created Nov 6, 2019
Quick note - how to fix django-livereload import error
View README.md

Error:

ImportError: cannot import name 'livereload_port' from 'livereload'

Cause:

You have both livereload and django-livereload installed. Most likely, one was installed before the other, and having both is an accident.

@hangtwenty
hangtwenty / README.md
Created Nov 6, 2019
Quick note - how to fix django-livereload import error
View README.md

Error:

ImportError: cannot import name 'livereload_port' from 'livereload'

Cause:

You have both livereload and django-livereload installed. Most likely, one was installed before the other, and having both is an accident.

@hangtwenty
hangtwenty / README.md
Created Nov 6, 2019
Quick note - how to fix django-livereload import error
View README.md

Error:

ImportError: cannot import name 'livereload_port' from 'livereload'

Cause:

You have both livereload and django-livereload installed. Most likely, one was installed before the other, and having both is an accident.

View aligning-images.md

Aligning images

left alignment

This is the code you need to align images to the left:

<img align="left" width="100" height="100" src="http://www.fillmurray.com/100/100">
@hangtwenty
hangtwenty / stash_dropped.md
Last active Oct 9, 2019 — forked from joseluisq/stash_dropped.md
How to recover a dropped stash in Git?
View stash_dropped.md

How to recover a dropped stash in Git?

1. Find the stash commits:

git log --graph --oneline --decorate $( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

You can’t perform that action at this time.