Skip to content

Instantly share code, notes, and snippets.

View pirate's full-sized avatar
🗃️
Archiving all the things!

Nick Sweeting pirate

🗃️
Archiving all the things!
View GitHub Profile
@cjbarber
cjbarber / unreplied.md
Last active December 23, 2022 14:58
RFS: Gmail Unreplied Messages

A Request for a Startup: Gmail 'Waiting For Reply' Tab

Problem:

  • I, Chris Barber, send many emails. I'd like to get more replies.

Solution:

  • A Chrome extension that adds a 'waiting for' tab to gmail.
@pirate
pirate / usernames.txt
Last active May 3, 2024 03:28
Untaken 3-letter Usernames on Github
None of these 3 letter-only usernames below are available anymore as of 2021.
However, if you use numbers and symbols, or accept 4 letters, you can definitely find a free one.
Check responsibly. Don't spam the github API/support, it's not a race, there are plenty free if you have imagination.
agq, ahq, aqf, aqg, aqp, aqt, aqf, aqy, atq, auh, ayp, azj, azq, bey, bgt, bgx, bhq, bkk, bkq, bmq,
bpp, bpq, bqa, bqc, bqg, bqi, bqj, bql, bqn, bqo, bqp, bqr, bqt, bqy, buo, buq, bwz, bxe, bxo, bxw,
bzn, bzp, cfl, ckg, ckq, cnq, cpq, cpz, cqa, cqe, cqf, cqg, cqk, cqo, cqp, cqf, cqx, cqz, cud, cuh,
cuk, cuo, cfl, cxe, czo, dkq, dnq, dqg, dqi, dqk, dqo, dqs, dsr, dtq, dxe, eaj, eaq, ebq, ecl, ecy,
eer, efq, efy, egq, egx, ehh, ehz, eiu, eiw, eiy, ejx, eoq, eou, epj, eqa, eqb, eqf, eqg, eqj, eqk,
eqs, eqf, eqw, eqz, erq, etq, eub, euf, euj, euq, euf, efq, efy, ewy, ewz, exn, eyh, eyj, eyn, eyq,
stems = ARGF.read
.split
.each_cons(2)
.group_by { |word_pair| word_pair[0] }
def next_word ary
ary[rand(ary.length).to_i][1]
end
e = Enumerator.new do |e|
@fadhlirahim
fadhlirahim / installing_supervisor_macosx.md
Last active December 31, 2023 14:45
Setting up supervisord in Mac OS X

Installation

Installing Supervisor on OS X is simple:

sudo pip install supervisor

This assumes you have pip. If you don't:

@goopi
goopi / django-profiling.sh
Created October 3, 2014 00:13
Profiling Django using runprofileserver and QCacheGrind
$ # install QCacheGrind (KCacheGrind)
$ brew install qcachegrind
$ brew install graphviz
$ brew linkapps
$ pip install django-extensions
$ # run profiling server
$ ./manage.py runprofileserver 0:3000 --kcachegrind --prof-path=path/to/profiles
anonymous
anonymous / sublime_text3_crack.md
Created June 7, 2015 04:58
Sublime Text 3092 3083 latest crack Win32 Win64 Linux64 Linux32 OSX Mac MacOS

cat

For pupil: all binary can be downloaded http://pan.baidu.com/s/1hqH2Pko

After overwriting, maybe need to run chmod +x /path/to/sublime_text. For linux default installation, need to add sudo.

For programmer:

VERSION PLATFORM OFFSET ORIGINAL CRACKED
@dropmeaword
dropmeaword / browser_history.md
Last active April 5, 2024 17:37
Playing around with Chrome's history

Browser histories

Unless you are using Safari on OSX, most browsers will have some kind of free plugin that you can use to export the browser's history. So that's probably the easiest way. The harder way, which seems to be what Safari wants is a bit more hacky but it will also work for other browsers. Turns out that most of them, including Safari, have their history saved in some kind of sqlite database file somewhere in your home directory.

The OSX Finder cheats a little bit and doesn't show us all the files that actually exist on our drive. It tries to protect us from ourselves by hiding some system and application-specific files. You can work around this by either using the terminal (my preferred method) or by using the Cmd+Shft+G in Finder.

Finder

Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.

@pirate
pirate / parseURLParameters.js
Last active December 15, 2023 07:17
Parse URL query parameters in ES6
function getUrlParams(search) {
const hashes = search.slice(search.indexOf('?') + 1).split('&')
const params = {}
hashes.map(hash => {
const [key, val] = hash.split('=')
params[key] = decodeURIComponent(val)
})
return params
}
@smcoll
smcoll / django_migration_pk_to_uuid.py
Last active January 24, 2024 15:55
Django migration converting integer pk table to UUID pk table
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import uuid
from django.db import migrations, models
def fill_mymodel_uuid(apps, schema_editor):
db_alias = schema_editor.connection.alias
MyModel = apps.get_model('myapp', 'MyModel')
@simonw
simonw / recover_source_code.md
Last active January 16, 2024 08:13
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb