Skip to content

Instantly share code, notes, and snippets.

View codeinvain's full-sized avatar

Daniel Cohen codeinvain

  • Cloudinary
  • Limassol, Cyprus
View GitHub Profile
// create a new database
// openDatabase(id,version,name,size)
var db = openDatabase("notes", "", "The Example Notes App!", 1048576);
// open transction
// db.transaction expects a function with a transaction argument in which the unit of work will be processed
db.transaction(function(tx) {
// if notes table does not exist create it
// transaction.executeSql(sqlString,arguments[,successCallback,errorCallback]);
//Session level storage
//------------------------
// set
sessionStorage.setItem("name","Daniel Cohen");
// get
sessionStorage.getItem("user"); // returns "Daniel Cohen"
// delete a single object (by key)
sessionStorage.removeItem("user")
// delete all keys (for session)
sessionStorage.clear();
// the whole project can be found @ http://github.com/codeinvain/RavenDB-EPG-Example
namespace RavenEGP.Utilities
{
class ETL
{
public DocumentStore Raven { get; set; }
public IDocumentSession Session { get; private set; }
public string Source { get; set; }
private Dictionary<string, Channel> channels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloRaven.model
{
class Channel
{
//RavenDB document identifier
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Raven.Client.Document;
using Raven.Client;
using HelloRaven.model;
namespace HelloRaven
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Browser;
using System.Dynamic;
namespace CodeInVain.Examples.Silverlight
{
class DynamicScriptObject:DynamicObject
{"Content-Type":"application/json"}