Skip to content

Instantly share code, notes, and snippets.

View kennethreitz's full-sized avatar

Kenneth Reitz kennethreitz

View GitHub Profile
@ipaulsmith
ipaulsmith / README.md
Last active November 2, 2026 06:28
Jev × NASA Kepler: a retrospective archive-disposition benchmark with exact requests, baselines and metrics

Jev × NASA Kepler

An independent test of Jev 1.13 against historical NASA archive classifications.

I took 8,054 historical Kepler Objects of Interest from the NASA Exoplanet Archive, hid the archive disposition (classification), and asked Jev to classify each object as CONFIRMED, CANDIDATE or FALSE POSITIVE. Jev is TypeSafe's model for choosing among predefined options; Kepler Objects of Interest are signals found in the Kepler space telescope's observations of dimming stars.

No fine-tuning. No examples from this dataset. One prediction per object, stored before its archive label was read.

8,054 calls · 0 failures · 322 ms median · ~$0.34 estimated

#!/usr/bin/env bash
# Install Xcode Command Line Tools.
xcode-select --install
# Install Homebrew.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install brew basics (auto-updating).
brew install terminal-notifier
@hanksudo
hanksudo / enable-ant-aliasing-vscode.md
Last active June 15, 2026 12:46
Enable font anti-aliasing on VS Code
vim /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.css

add to .editor-container section

-webkit-font-smoothing: antialiased;
@lavaldi
lavaldi / tweaks-sublime-italic-operator-mono.md
Created March 16, 2017 02:02
Operator Mono & Sublime Text 3 themes
  1. Install Package Resource Viewer.
  2. In package control window select ‘Package Resource Viewer: Open Resource’.
  3. Scroll down until you find the option: ‘Color Scheme — Default’ (or your theme with color scheme .tmTheme) and select it.
  4. Add the following
<!-- Operator Tweaks -->
  <dict>
    <key>name</key>
 Italic HTML attribute names
@alexellis
alexellis / base.Dockerfile
Last active August 10, 2026 17:50
Docker swarm service to mine into the Nice Hash pool
# Published on Docker Hub with above user alexellisio.
# If you want to rebuild your own copy, follow below instructions
# Build this on each type of machine so you have the correct CPU extensions.
FROM alexellisio/boostbase
RUN git clone -b Linux https://github.com/nicehash/nheqminer.git
RUN cd nheqminer/cpu_xenoncat/Linux/asm/ && sh assemble.sh && cd ../../../Linux_cmake/nheqminer_cpu && cmake . && make
ENTRYPOINT ["./nheqminer/Linux_cmake/nheqminer_cpu/nheqminer_cpu"]
@saggiyogesh
saggiyogesh / mongo_dump_restore.md
Last active June 3, 2026 12:57
Mongodb dump and restore from mlab
  • install mongodb on local machine (mongodump & mongorestore) commands are required.
  • command dumping

mongodump -h xxx11.mlab.com:11 -u user -p password --authenticationDatabase release-db -d release-db -o /home/dumps

**Options** `-h`: mlab host:port, `-u`: db user, `-p`: db user password, `--authenticationDatabase` `-d`: mlab dbname, `-o`: path to store backupfiles
  • restore command, to restore locally

    mongorestore --db dname /home/dumps

Otherwise to restore in mlab, create a new db and replace the options

@kennethreitz
kennethreitz / check.sh
Created February 7, 2016 15:48
How to find out why your RST isn't rendering on PyPi
pip install readme-renderer && python setup.py check -rs

Most downloaded projects

SELECT
  file.project,
  COUNT(*) as total_downloads,
FROM
  TABLE_DATE_RANGE(
    [the-psf:pypi.downloads],
    TIMESTAMP("20160114"),
@rmondello
rmondello / gist:b933231b1fcc83a7db0b
Last active May 31, 2026 14:41
Exporting (iCloud) Keychain and Safari credentials to a CSV file

Exporting (iCloud) Keychain and Safari credentials to a CSV file

Update (October 2021)

Exporting password + one-time code data from iCloud Keychain is now officially supported in macOS Monterey and Safari 15 (for Monterey, Big Sur, and Catalina). You can access it in the Password Manager’s “gear” icon (System Preferences > Passwords on Monterey, and Safari > Passwords everywhere else), or via the File > Export > Passwords... menu item). You shouldn't need to hack up your own exporter anymore.

Original, Obsolete Content (2014)

After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.

import os
from datetime import datetime
from multiprocessing.util import register_after_fork
from sqlalchemy import create_engine, MetaData, Table
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from psycopg2.extras import RealDictConnection, register_hstore