Skip to content

Instantly share code, notes, and snippets.

Building a better world, one bit at a time

Nick Kocharhook nk9

Building a better world, one bit at a time
  • London, UK
View GitHub Profile
nk9 / github_user_script.js
Created Dec 29, 2022
User script for scraping GitHub results as URLs
View github_user_script.js
// ==UserScript==
// @name Copy GitHub results
// @namespace
// @version 0.1
// @description try to take over the world!
// @author You
// @match*
// @grant none
// ==/UserScript==
nk9 /
Last active Jan 17, 2023
Python script to get the URL of a file in the Dropbox folder
# coding=utf-8
# Copyright 2021 Nick Kocharhook
# MIT Licensed
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
nk9 / KVLWindow.swift
Last active May 7, 2021
A window that uses overlays to show its first responder and ALL of the views which have that responder as their nextValidKeyView. Useful for debugging key view loop issues in macOS applications.
View KVLWindow.swift
// KVLWindow.swift
// KVLTest
// Created by Nick Kocharhook on 04/05/2021.
// Based in part on LMWindow by Micha Mazaheri
// Released under the MIT License:
// Copyright 2021 Nick Kocharhook
nk9 / LMWindow.m
Last active Aug 25, 2020 — forked from mittsh/LMWindow.m
How to debug your key view loop: highlights
View LMWindow.m
* Copyright (c) 2013 Micha Mazaheri
* Released under the MIT License:
* Updated to work on Xcode 11 in 2020 by Nick Kocharhook
#define LMWindowDEBUGResponders
#ifdef LMWindowDEBUGResponders
nk9 / nick.zsh-theme
Created Feb 17, 2020
My oh-my-zsh theme
View nick.zsh-theme
setopt prompt_subst
PROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )%{$reset_color%}"
PROMPT+=' %(!.%{$fg[red]%}.%{$fg[green]%})$(shrink_path -l -t)%{$fg_bold[blue]%}$(git_prompt_info)%{$reset_color%} '
nk9 /
Last active Oct 22, 2019
Flask-Security registration with pending role
from flask_security.decorators import anonymous_user_required
from flask_security.utils import encrypt_password
from flask_security.confirmable import send_confirmation_instructions
@bp.route('/register/', methods=['GET', 'POST'])
def register():
form = ExtendedRegistrationForm(request.form)
if form.validate_on_submit():
nk9 / leaflet.draw-error.html
Last active May 25, 2019
When you parse a GeoJSON string containing a MultiPolygon, leaflet.draw throws exceptions when you try to edit the resulting layer.
View leaflet.draw-error.html
<script src=""></script>
<link rel="stylesheet" href=""/>
<script src=""></script>
<link rel="stylesheet" href=""/>
<div id="map" style="width: 500; height: 500"></div>

Keybase proof

I hereby claim:

  • I am nk9 on github.
  • I am k9 ( on keybase.
  • I have a public key ASDidn08tGKp2M4ugDD0cE1gl-8vD44qx5oRz9jJrjUPpgo

To claim this, I am signing this object:

nk9 /
Last active Jul 11, 2016
Mis-directed links in Ada
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
urlFormat = ""
urls = [urlFormat % x for x in range(1, 40)] # Only chapteres 1-39 are annotated
for url in urls:
response = requests.get(url)
nk9 / cfnetwork-map.json
Created Feb 5, 2015
This is a JSON mapping of CFNetwork versions to OS X versions. It's been culled from UserAgent strings.
View cfnetwork-map.json
"CFNetwork/1.1": "10.2",
"CFNetwork/1.2.1": "10.3.2",
"CFNetwork/1.2.2": "10.3.9",
"CFNetwork/1.2.6": "10.3.9",
"CFNetwork/128": "10.4.0 (PPC)",
"CFNetwork/128": "10.4.1 (PPC)",
"CFNetwork/128.2": "10.4.2 (PPC)",
"CFNetwork/129.10": "10.4.4",
"CFNetwork/129.10": "10.4.5",