Skip to content

Instantly share code, notes, and snippets.

View codeinvain's full-sized avatar

Daniel Cohen codeinvain

  • Cloudinary
  • Limassol, Cyprus
View GitHub Profile
{"Content-Type":"application/json"}
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
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;
namespace HelloRaven.model
{
class Channel
{
//RavenDB document identifier
// 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;
//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();
// 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]);
// Flex 3.x true RTL support
// this class depends on text layout framework
// you can download it from http://labs.adobe.com/technologies/textlayout/ and follow installation instructions
package ui
{
import flashx.textLayout.container.DisplayObjectContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" initialize="init()" xmlns:ui="ui.*" horizontalScrollPolicy="off" verticalScrollPolicy="off" implements="mx.managers.IFocusManagerComponent">
<mx:Script>
<![CDATA[
import flash.text.engine.*;
import mx.core.FlexSprite;
import mx.core.UIComponent;
import mx.controls.Alert;
private var _fontFamily:String;
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>HtmlTextInput host</title>
<style>
#htmlInput
{