Skip to content

Instantly share code, notes, and snippets.

View JustinTArthur's full-sized avatar

Justin Turner Arthur JustinTArthur

View GitHub Profile
@amcclosky
amcclosky / gist:994139
Created May 26, 2011 21:34
This will return a list of alter table statements which drop all foreign keys from the given database in MySQL. (via http://goo.gl/9ZD9N)
SELECT concat('alter table ',table_schema,'.',table_name,' DROP FOREIGN KEY ',constraint_name,';') from information_schema.table_constraints WHERE constraint_type='FOREIGN KEY' AND table_schema='<database_name>';
@j2labs
j2labs / gist:1088546
Created July 18, 2011 04:31
Concurrent pymongo inserts with Eventlet
#!/usr/bin/env python
###
### Concurrent pymongo inserts
###
import eventlet
pymongo = eventlet.import_patched('pymongo')
### Setup database connection
@nicnilov
nicnilov / gist:308e3eed69f6b31224730848242d5446
Last active October 9, 2024 19:11
Attach and mount a macOS system drive raw image
===
Create a raw image
===
# Find the drive identifier
diskutil list
# Unmount the cached drive representation
diskutil unmountDisk <disk>