Consider this blog post model:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.core.management.base import BaseCommand, CommandError | |
| from django.db.models import get_models, get_app, fields | |
| from django.db.models.fields import related | |
| class Command(BaseCommand): | |
| help = """Generate factory-boy factories for the given app""" | |
| def handle(self, *args, **options): | |
| assert len(args) == 1, 'Must specify app name as first and only argument' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define -mem-heap-dump-chunk | |
| printf "%#016x: ", $mem_addr | |
| printf "%016lu %016lu %#02x ", ((long *)$mem_addr)[0], ((long *)$mem_addr)[1] & ~3, ((long*)$mem_addr)[1] & 3 | |
| printf "%016x %016x\n", ((long *)$mem_addr)[2], ((long *)$mem_addr)[3] | |
| set $mem_addr = $mem_addr + ((long *)$mem_addr)[1] & ~3 | |
| end | |
| document -mem-heap-dump-chunk | |
| !!! FOR INTERNAL USE ONLY - DO NOT CALL !!! | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'yaml' | |
| # A demonstration of YAML anchors, references and handling of nested values | |
| # For more info, see: | |
| # http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/ | |
| stooges = YAML::load( File.read('stooges.yml') ) | |
| # => { | |
| # "default" => { |
NewerOlder