Skip to content

Instantly share code, notes, and snippets.

View Oustad's full-sized avatar

Mats Oustad Oustad

View GitHub Profile
app.filter('orderMe', function ($filter){
return function(items, sorter){
if(sorter === 'price')
{
return $filter('orderBy')(items, 'price');
}
if(sorter === 'theme')
{
return _.filter(items, 'theme');
}
//loads the javascripts that groupsdocs viewer needs
<head>@Html.CreateViewerScriptLoadBlock().LoadJquery().LoadJqueryUi()</head>
<div id="documentContainer"></div>
@(Html.ViewerClientCode()
.TargetElementSelector("#documentContainer")
.Stream(SomeDotNetStream) // fetch document from a stream
//.Url("SomeUrl") fetch from a url
//.FilePath("SomeFile") fetch from filepath
<add name="ViewDocumentHandler" verb="GET,POST" path="document-viewer/ViewDocumentHandler" type="Groupdocs.Web.UI.Handlers.ViewDocumentHandler, Groupdocs.Viewer, Culture=neutral" />
<add name="GetDocumentPageImageHandler" verb="GET,POST" path="document-viewer/GetDocumentPageImageHandler" type="Groupdocs.Web.UI.Handlers.GetDocumentPageImageHandler, Groupdocs.Viewer, Culture=neutral" />
<add name="LoadFileBrowserTreeDataHandler" verb="GET,POST" path="document-viewer/LoadFileBrowserTreeDataHandler" type="Groupdocs.Web.UI.Handlers.LoadFileBrowserTreeDataHandler, Groupdocs.Viewer, Culture=neutral" />
<add name="GetImageUrlsHandler" verb="GET,POST" path="document-viewer/GetImageUrlsHandler" type="Groupdocs.Web.UI.Handlers.GetImageUrlsHandler, Groupdocs.Viewer, Culture=neutral" />
<add name="GetCssHandler" verb="GET" path="document-viewer/CSS/GetCssHandler" type="Groupdocs.Web.UI.Handlers.CssHandler, Groupdocs.Viewer, Culture=neutral" />
<add name="images" verb="GET" path="document-viewer/images/*" type="Groupdocs.W
Viewer.InitRoutes();
Viewer.SetRootStoragePath(Server.MapPath("SomePath")); // Documents will also be cached here
Viewer.SetLicensePath(Server.MapPath("SomePathToYourLisenceFile"));
@Oustad
Oustad / wholiveswhere.rb
Created November 21, 2011 22:12
Quick hacky solution of the Dinesman dwelling puzzle
class Array
def randomize
sort_by { rand }
end
def randomize!
self.replace randomize
end
end
class Persons