Skip to content

Instantly share code, notes, and snippets.

View nc7s's full-sized avatar

Blair Noctis nc7s

View GitHub Profile
@reorx
reorx / thunderbird_customization.md
Last active July 27, 2022 15:50
Thunderbird customization configs
@BookGin
BookGin / firefox-unregister-all-service-workers.js
Last active July 12, 2023 16:10
Unregister all service workers in Firefox.
# navigate to about:debugging#workers first
for (let k of document.getElementsByClassName("unregister-link")) k.click()
for (let k of document.getElementsByClassName("qa-unregister-button")) k.click()
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active July 22, 2024 17:46
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@qwexvf
qwexvf / app.py
Created October 17, 2017 07:17
Python Steam Login
from flask import Flask, redirect
from urllib import parse
import requests
import json
app = Flask(__name__)
@app.route('/')
def hello_world():
steam_openid_url = 'https://steamcommunity.com/openid/login'
@imjasonh
imjasonh / markdown.css
Last active May 24, 2024 22:56
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
@sindresorhus
sindresorhus / treewalker-performance.md
Created March 6, 2012 23:22
TreeWalker performance

Test the performance of TreeWalker compared to other DOM walker methods. Ran each test 1000 times. Try it yourself.

Chrome 17

Method                  Total ms    Average ms
document.TreeWalker     911         0.911
Iterative Traverser     2945        2.945