Skip to content

Instantly share code, notes, and snippets.

View mcfiredrill's full-sized avatar
💭
working on datafruits

Tony Miller mcfiredrill

💭
working on datafruits
View GitHub Profile

Overview

Replicate is a Gem that lets you dump and load relational objects between Ruby/Ruby on Rails environments, e.g. dump data from your production database and load it in your development database.

The examples given in the README are of shell scripts being used to do this. I wanted to use a Capistrano task because it keeps everything related to the production site in one place (particularly the config).

Note: This is tested on a relatively small data set yet it still took about 20 seconds to run - YMMV!

Usage

  • Add the code below to your config/deploy.rb
  • Alter the code = ENV["DATA"] || "User.all; Project.all" line to list all the data you want dumped by default
@mcfiredrill
mcfiredrill / SDL Audio.cpp
Created April 3, 2024 18:26 — forked from andraantariksa/SDL Audio.cpp
SDL simple record and playback
#include <SDL.h>
#include <cstdio>
#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <ctime>
const int MAX_RECORDING_DEVICES = 10;