Skip to content

Instantly share code, notes, and snippets.

$(window).bind('mercury:ready', function() {
var link = $('#mercury_iframe').contents().find('#edit_link');
Mercury.saveURL = link.data('save-url');
link.hide();
});
$(window).bind('mercury:saved', function() {
window.location = window.location.href.replace(/\/editor\//i, '/');
});
@chandresh
chandresh / image.rb
Created January 9, 2012 01:48
Mercury image upload using mongoid and paperclip
class Mercury::Image
include Mongoid::Document
include Mongoid::Timestamps
field :image_file_name, type: String
field :image_content_type, type: String
field :image_file_size, type: String
field :image_updated_at, type: DateTime
# -- todo: add stuff related to paperclip
@chandresh
chandresh / Gemfile
Created January 9, 2012 04:38
Alternative mercury.js for Railscasts#296, based on current version at github
gem 'mercury-rails', git: 'https://github.com/jejacks0n/mercury.git'

Pressman: Chess like game with all queens

Board Setup: The board is basically like Chess with 64 squares (8X8). The difference being that the squares are not checkered (alternatively colored).

Its a two player game. Both the players have a side across the horizontal board - two rows (16 squares) of pieces [white or black]. The player with black pieces start the game.

Home row: The first row from each opponents end is called home row.

Game play: The players move alternatively. The moves are:

@chandresh
chandresh / gist:5802018
Created June 18, 2013 01:41
mongoid config
development:
# Configure available database sessions. (required)
sessions:
# Defines the default session. (required)
default:
# Defines the name of the default database that Mongoid can connect to.
# (required).
database: mongoexample_development
# Provides the hosts the default session can connect to. Must be an array
# of host:port pairs. (required)
Home Work
1. Take your template
2. Create the mongoid based project
3.
- Admin can create categories
- Admin can create products
- Admin can view orders
@chandresh
chandresh / gist:5843478
Created June 23, 2013 02:22
Class Work for today
Class Work:
Create account in github.
3 pages:
1. Homepage:
- image
fghgfhf
fdsfds
dsfdsfds