diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`where XXXXX is the size of the RAM disk in terms of memory blocks.
Notes:
| #!/bin/zsh | |
| # WARNING! The script is meant to show how and what can be disabled. Don’t use it as it is, adapt it to your needs. | |
| # Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3 | |
| # Disabling unwanted services on macOS Big Sur (11), macOS Monterey (12), macOS Ventura (13), macOS Sonoma (14) and macOS Sequoia (15) | |
| # Disabling SIP is required ("csrutil disable" from Terminal in Recovery) | |
| # Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist, disabled.501.plist | |
| # To revert, delete /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist and reboot; sudo rm -r /private/var/db/com.apple.xpc.launchd/* | |
| # user |
Many different applications claim to support regular expressions. But what does that even mean?
Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.
The information here is just copied from: http://regular-expressions.mobi/refflavors.html
| #!/bin/bash | |
| # Tom Hale, 2016. MIT Licence. | |
| # Print out 256 colours, with each number printed in its corresponding colour | |
| # See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163 | |
| set -eu # Fail on errors or undeclared variables | |
| printable_colours=256 |
| /** | |
| Generate a random date sometime between now and n days before day. | |
| Also, generate a random time to go with the day while we are at it. | |
| @param days date range between today and minimum date to generate | |
| @return random date | |
| @see http://stackoverflow.com/questions/10092468/how-do-you-generate-a-random-date-in-objective-c | |
| */ |
| import re | |
| from sqlalchemy.ext.compiler import compiles | |
| from sqlalchemy.schema import CreateTable, DropTable, \ | |
| CreateSequence, DropSequence, CreateIndex, DropIndex | |
| from sqlalchemy.dialects.postgresql import DropEnumType | |
| patches = ( | |
| (CreateTable, 'visit_create_table', "^\s*CREATE TABLE", "CREATE TABLE IF NOT EXISTS"), | |
| (CreateIndex, 'visit_create_index', "^\s*CREATE INDEX", "CREATE INDEX IF NOT EXISTS"), |
| from sqlalchemy_dump import dump_sql | |
| def create_all_sql(metadata): | |
| return dump_sql(metadata.create_all, bind=True)() | |
| def drop_all_sql(metadata): | |
| return dumpsql(metadata.drop_all, bind=True)() |
| # based on: https://gist.github.com/exhuma/5935162#file-representable_base-py | |
| class RepresentableBase(object): | |
| """ Add automatic __repr__ and __str__ to SQLAlchemy ORM models | |
| """ | |
| def _repr_worker(self, attribute): | |
| mapper = object_mapper(self) | |
| items = [(p.key, getattr(self, p.key)) | |
| for p in ( | |
| mapper.get_property_by_column(c) |