- Bytes and Blobs by David Flanagan
- Conference Wifi Redux by Malte Ubi
- Sashimi - https://github.com/cramforce/Sashimi
- Run Your JS everywhere with Jellyfish by Adam Christian - http://jelly.io Project
- Fighting Crime and Kicking Apps with Batman.js by Nick Small
- Hello Jo by Dave Balmer - Project - http://joapp.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Tutorial example from: | |
* Your First ASP.NET Web API (C#): | |
* http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api | |
*/ | |
namespace HelloWebAPI.Controllers | |
{ | |
public class ProductsController : ApiController | |
{ | |
Product[] products = new Product[] | |
{ |
public interface IService
{
Customer GetCustomerById(int id);
Customer[] GetCustomerByIds(int[] id);
Customer GetCustomerByUserName(string userName);
Customer[] GetCustomerByUserNames(string[] userNames);
Customer GetCustomerByEmail(string email);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3 different ways to return an image. | |
// More info about other responses http://stackoverflow.com/questions/6245616/does-servicestack-support-binary-responses | |
using System; | |
using System.Collections.Generic; | |
using System.Drawing; | |
using System.Drawing.Imaging; | |
using System.IO; | |
using ServiceStack.Common.Web; | |
using ServiceStack.Service; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Adds $.xhr and jQuery-like $.ajax methods to the prescribed namespace. | |
//Inspired from David Flanagans excellent cross-platform utils http://www.davidflanagan.com/javascript5/display.php?n=20-1&f=20/01.js | |
//Includes underscore.js _.each and _.extend methods | |
//modified to behave like jQuery's $.ajax(), not complete. | |
(function($) { | |
var win=window, xhrs = [ | |
function () { return new XMLHttpRequest(); }, | |
function () { return new ActiveXObject("Microsoft.XMLHTTP"); }, | |
function () { return new ActiveXObject("MSXML2.XMLHTTP.3.0"); }, | |
function () { return new ActiveXObject("MSXML2.XMLHTTP"); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let $ = (sel, el) => typeof sel === "string" ? (el || document).querySelector(sel) : sel || null, | |
$$ = (sel, el) => Array.prototype.slice.call((el || document).querySelectorAll(sel)); | |
function on(sel, handlers) { | |
$$(sel).forEach(e => { | |
Object.keys(handlers).forEach(function (evt) { | |
let fn = handlers[evt]; | |
if (typeof evt === 'string' && typeof fn === 'function') { | |
e.addEventListener(evt, fn.bind(e)); | |
} |
I hereby claim:
- I am mythz on github.
- I am mythz (https://keybase.io/mythz) on keybase.
- I have a public key ASAeJidstT7bc7YfiJpDh_XTzcEFOsssBSa-CfwM_aQJlwo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let btnUp = new Button("Increment", Visible=true) | |
let btnDown = new Button("Decrement", Visible=true) | |
let lbl = new Label(Text=" Count: 0", Visible=true) | |
Event.merge | |
(btnUp.Clicked |> Event.map (fun _ -> +1)) | |
(btnDown.Clicked |> Event.map (fun _ -> -1)) | |
|> Event.scan (+) 0 | |
|> Event.map (sprintf " Count: %d") | |
|> Event.add (fun s -> lbl.Text <- s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ServiceStack | |
{ | |
public interface IServiceClient : IServiceClientAsync, IOneWayClient, IRestClient, IReplyClient, IHasSessionId, IHasVersion | |
{ | |
int Version { get; set; } //IHasVersion | |
string SessionId { get; set; } //IHasSessionId | |
//IReplyClient: | |
TResponse Send<TResponse>(object request); | |
TResponse Send<TResponse>(IReturn<TResponse> request); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using ServiceStack; | |
using ServiceStack.Text; | |
using ServiceStack.OrmLite; | |
using ServiceStack.OrmLite.Sqlite; | |
using ServiceStack.DataAnnotations; | |
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider); | |
var db = dbFactory.Open(); // Open ADO.NET DB Connection |
NewerOlder