Skip to content

Instantly share code, notes, and snippets.

_ _ _ ____ _ _
| | | | __ _ ___| | __ | __ ) __ _ ___| | _| |
| |_| |/ _` |/ __| |/ / | _ \ / _` |/ __| |/ / |
| _ | (_| | (__| < | |_) | (_| | (__| <|_|
|_| |_|\__,_|\___|_|\_\ |____/ \__,_|\___|_|\_(_)
A DIY Guide
@rbtsolis
rbtsolis / middleware.py
Created May 3, 2018 02:46
Django Access the Request or User Object Inside the Models and Signals
# 1) Create a middlewares/middlewares.py file and copy this:
import threading
class RequestMiddleware:
def __init__(self, get_response, thread_local=threading.local()):
self.get_response = get_response
self.thread_local = thread_local
# One-time configuration and initialization.
@coder0xff
coder0xff / dropbox_ignore.sh
Last active May 2, 2024 13:09
dropbox_ignore.sh
#!/bin/bash
# This script sets or clears the Dropbox ignore attribute
# on files to reflect what is ignored by git.
# Usage: dropbox_ignore.sh [-n] [-q] [-v]"
# -n: Dry run"
# -q: Quiet"
# -v: Verbose"

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone git@gist.github.com:<hash>.git     # or with ssh
@kepano
kepano / obsidian-web-clipper.js
Last active May 2, 2024 13:07
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@RaphaelWimmer
RaphaelWimmer / endscopetool.py
Created June 21, 2023 23:46
Python implementation of the endscopetool (sic!) Android application used for the Vitcoco ear wax remover camera thingy.
#!/usr/bin/env python3
# Python implementation of the endscopetool (sic!) Android application used for the Vitcoco ear wax remover camera thingy.
# CC-0 / Public Domain
# (0) 2023 Raphael Wimmer
# v0.01
# reverse-engineered using a packet capture log - this means that I have no idea what all those magic numbers mean
# and whether there are further features that might be supported by the hardware
# usage: first connect to the 'softish-XXXX' wifi, then run this script. Check code for keyboard shortcuts.
import socket
@sergiecode
sergiecode / curso-java.md
Last active May 2, 2024 13:06
Instalaciones Necesarias y recomendadas para el curso de JAVA
@OleksandrKucherenko
OleksandrKucherenko / version-up.sh
Last active May 2, 2024 13:04
Calculate Next Suitable Version Tag for Your Git based project
#!/usr/bin/env bash
# shellcheck disable=SC2155
## Copyright (C) 2017, Oleksandr Kucherenko
## Last revisit: 2023-09-30
## Version: 2.0.2
## License: MIT
## Fix: 2023-10-01, prefix for initial INIT_VERSION was not applied
## Fix: 2023-10-01, correct extraction of latest tag that match version pattern
## Added: 2023-09-30, @mrares prefix modification implemented
@vadikgo
vadikgo / remap.md
Last active May 2, 2024 13:02
Remap HHKB Pro Eject key to Media Play/Pause

Remap HHKB Pro Eject key to Media Play/Pause

Run in a terminal

hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0xC000000B8,"HIDKeyboardModifierMappingDst":0xC000000CD}]}'

Add remap on startup

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.