Skip to content

Instantly share code, notes, and snippets.

Avatar

srdjan srdjan

View GitHub Profile
View fun.cs
using System;
using System.Collections.Generic;
namespace ConsoleApplication1 {
class Program {
static void Main() {
//-- define an Action that will perfom a query
Action<List<string>> query = r => r.AddRange(QuerySomething());
//-- invoke it and show results ;)
@srdjan
srdjan / func-overload.js
Created Jun 19, 2014
javascript function overloading...
View func-overload.js
var get = (function() {
var overrides = {
getAll: function() {
console.log('return all...');
return this;
},
getById: function(args) {
console.log('return by id:' + args);
return this;
},
View api-diff-no-overloads.js
getAll();
getById(5);
getByExpr('id > 5');
View api-with-overloads.js
get();
get(5);
get('id > 5');
View owin.simplr-middleware.cs
namespace Simplr.Middleware {
public class ResourceResolver : MiddlewareBase {
public override Task Process(IContext context) {...}
}
public class HypermediaValidator : MiddlewareBase {
public override Task Process(IContext context) {...}
}
//...
//additional middleware components
}
View owin.simplr.app.r.cs
using SimplR.Resources;
using SimplR.Hypermedia;
using SimplR.Services;
using App.Domain.Users;
namespace App.Resources.Users {
public class UsersResource : Resource<User> {
public override List<User> Get() {...}
public override User Get(int id) {...}
public override User Post(User user) {...}
View owin.simplr.runner.cs
using Simplr.Middleware;
namespace App.Runner {
internal static class Program {
static void Main() {
var _pipeline = new Pipeline()
.Use(new ResourceResolver())
.Use(new HypermediaValidator())
.Use(new ApiCall())
.Use(new HypermediaUpdater())
View owin.simplr.app.cqrs.cs
using SimplR.Resources;
using SimplR.Hypermedia;
using SimplR.Services;
using App.Domain.Users;
namespace App.Handlers.Users {
public class UsersHandler : IHandler<User> {
public List<User> Query(Expression expr) {...}
public void CreateCommand(User user) {...}
public void UpdateCommand(User user) {...}
View keybase.md

Keybase proof

I hereby claim:

  • I am Srdjan on github.
  • I am srdjan (https://keybase.io/srdjan) on keybase.
  • I have a public key whose fingerprint is 2921 E5C1 5268 9C43 CBC2 F09B 2795 2062 AEFD BC91

To claim this, I am signing this object:

@srdjan
srdjan / hamlet-todo-model.coffee
Last active Aug 29, 2015
Hamlet: expressive, intuitive templates (http://hamlet.coffee)
View hamlet-todo-model.coffee
//- Model: ----------------------------------------
items = Observable []
completeAll = Observable(false)
completeAll.observe (val) ->
items.forEach (i) ->
i.checked(val)
model =
removeFinished: ->
You can’t perform that action at this time.