Skip to content

Instantly share code, notes, and snippets.

@thecodeduchess
thecodeduchess / Rake Database.md
Created February 24, 2018 00:52 — forked from stevenyap/Rake Database.md
List of rake commands to manage database

Create database

rake db:create

Create database table

This will creates a migration file in /db/migrate without table definition.

rails g migration create_<TABLE>
@thecodeduchess
thecodeduchess / Music Player class
Last active January 11, 2016 02:43
Code Provided to use using java zoom. It just works. Should be second class in app.
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.IOException;
import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.AudioDevice;
import javazoom.jl.player.FactoryRegistry;
import javazoom.jl.player.advanced.AdvancedPlayer;
/**
@thecodeduchess
thecodeduchess / Music Organizer class Step 1
Last active January 11, 2016 02:47
Step 1 of the music player, Make a music organizer class
import java.util.ArrayList;
/**
* A class to hold details of audio files.
*/
public class MusicOrganizer
{
// An ArrayList for storing the file names of music files.
private ArrayList<String> files;
@thecodeduchess
thecodeduchess / blog.md
Last active August 29, 2015 14:19
How to add AJAX to my blog?

I want to implement ajax for comments to the blog post so that instead of refreshing, it fades in.

Code that works in another app:

Posts SHOW.html.erb

<h2>Comments</h2>
<div id="comments">
<%= render :partial => @post.comments.reverse %>