Skip to content

Instantly share code, notes, and snippets.

View beaulac's full-sized avatar

antoine beauᵛᵃᴵˢ⁻lacᵃˢˢᵉ beaulac

View GitHub Profile
@nfarina
nfarina / mock-storage.js
Last active November 23, 2023 15:50
Mock Google Cloud Storage for JS
//
// Quick & Dirty Google Cloud Storage emulator for tests. Requires
// `stream-buffers` from npm. Use it like this:
//
// `new MockStorage().bucket('my-bucket').file('my_file').createWriteStream()`
//
class MockStorage {
buckets: {[name: string]: MockBucket};
@xtfer
xtfer / gist:6127781
Last active January 30, 2019 22:19
Sanitize a Drupal 7 database adapted from http://drupalscout.com/knowledge-base/creating-sanitized-drupal-database-backup This sets all passwords to "password". I run this using Sequel Pro, which will continue to run when errors occur, as it treats each line as a separate transaction.
UPDATE users SET mail = CONCAT(name, '@localhost'), init = CONCAT(name, '@localhost'), pass = '$S$Cd059Vsxc8berFeg6hspaa7ejx2bSxyUisvCbT4h9o8XIgSUtPKz';
UPDATE comment SET mail = CONCAT(name, '@localhost');
UPDATE authmap SET authname = CONCAT(aid, '@localhost');
UPDATE webform_submitted_data set data='scrubbed';
TRUNCATE accesslog;
TRUNCATE cache;
TRUNCATE cache_block;
TRUNCATE cache_bootstrap;