Run two Claude Code accounts simultaneously on macOS without re-authenticating by using separate configuration directories.
- Create Separate Config Directories
mkdir ~/.claude-account1 mkdir ~/.claude-account2
If you need to override an autocomplete's behaviour based on its use in a django form, it is how I managed to do it.
Normally you would use formfield_for_foreignkey but when using autocomplete_fields is not taken in account by django admin.
Note: this is not dynamic based based on the values in the form
| from myapp.models import MyModel | |
| from django.test import TestCase | |
| import pgbulk | |
| from time import perf_counter | |
| class TestPgBulk(TestCase): | |
| @classmethod | |
| def setUpTestData(cls): | |
| cls.number_of_objects = 25_000 |
| from django.db.models import OuterRef | |
| weapons = Weapon.objects.filter(unit__player_id=OuterRef('id')) | |
| units = Unit.objects.filter(player_id=OuterRef('id')) | |
| qs = Player.objects.annotate(weapon_count=SubqueryCount(weapons), | |
| rarity_sum=SubquerySum(units, 'rarity')) |
First, install those two extensions:
Ok now you can keep reading!
Use de "track_memory" decorator on your functions.
| #!/usr/bin/env bash | |
| function dumpBundle { | |
| FILE=$1 | |
| OUTDIR=$2 | |
| LZMADIR=$3 | |
| OUTPATH="$OUTDIR/$FILE" | |
| LZMAPATH="$LZMADIR/$FILE" | |
| mkdir -p $(dirname "$OUTPATH") |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # IPS Patcher | |
| # Copyright (©) itari 2014 | |
| # Do whatever you want with this, I don't care. :D | |
| # | |
| # Modified by sli to work on the command line and with | |
| # Python 3. Who even uses Tkinter anymore? |
http://angular.github.io/protractor/#/api
Note: Most commands return promises, so you only resolve their values through using jasmine expect API or using .then(function()) structure
Based on this post: https://spagettikoodi.wordpress.com/2015/01/14/angular-testing-cheat-sheet/ by @crystoll
browser.get('yoururl'); // Load address, can also use '#yourpage'