Skip to content

Instantly share code, notes, and snippets.

View tjaskula's full-sized avatar
🎸
C++

Tomasz Jaskula tjaskula

🎸
C++
View GitHub Profile
@harleyholt
harleyholt / example-if-template.html
Created October 20, 2011 22:24
Example of Knockout Conditionally Rendered Template
<!-- Example one shows the most verbose way of specifying a template that is only rendered if someObject is defined in the current view model
This information was culled from https://github.com/SteveSanderson/knockout/blob/1.3/src/binding/defaultBindings.js#L445
-->
<script type="text/html" id="sub-example-one">
<h2 data-bind="text: title"></h2>
<p data-bine="text: description"></p>
</script>
<script type="text/html" id="example-one">
@jgonera
jgonera / gist:3084341
Created July 10, 2012 16:05
Google Chart: Scatter Chart with a line
<!doctype html>
<html>
<head>
<title>Google Chart: Scatter Chart with a line</title>
<meta charset="UTF-8" />
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", { packages: ["corechart"] });
google.setOnLoadCallback(drawChart);
function drawChart() {
{
"_links": {
"self": { "href": "/foo" },
},
"_controls": {
"attack": {
"target": "/attacks",
"method": "POST",
"headers": {
"Content-Type": "application/json"
@AArnott
AArnott / ApmExtensions.cs
Last active May 1, 2020 21:40
Converts .NET TPL async task pattern to the APM pattern. See [Stephen Toub's blog post](http://blogs.msdn.com/b/pfxteam/archive/2011/06/27/10179452.aspx)
// LICENSED under the Ms-PL (http://opensource.org/licenses/MS-PL)
public static Task<TResult> ToApm<TResult>(this Task<TResult> task, AsyncCallback callback, object state) {
if (task == null) {
throw new ArgumentNullException("task");
}
if (task.AsyncState == state) {
if (callback != null) {
task.ContinueWith(
@SzymonPobiega
SzymonPobiega / gist:5220595
Last active April 25, 2024 17:19
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht
@philcleveland
philcleveland / GetEventStoreEventDispatcher.cs
Last active December 16, 2015 05:19
GetEventStore Event Dispatcher EventStore.ClientAPI compatable v1.1.0
//Special thanks to Andrii Nakryiko and James Nugent
//for their help with this code.
namespace Infrastructure.EventStorage
{
using System;
using System.Collections.Concurrent;
using System.Net;
using System.Text;
using System.Threading;
using EventStore.ClientAPI;
public class GetEventStoreEventDispatcher
{
private readonly IEventBus _eventBus;
private readonly EventStoreConnection _connection;
private bool _stopRequested;
private EventStoreAllCatchUpSubscription _subscription;
private readonly IPersistGetEventStorePosition _positionRepository;
public GetEventStoreEventDispatcher(EventStoreConnection connection, IEventBus eventBus, IPersistGetEventStorePosition positionRepository)
@swlaschin
swlaschin / type-dependency-graph.fsx
Last active March 4, 2021 19:24
This script analyzes the dependencies between top level types in a .NET Assembly. It is then used to compare the dependency relationships in some F# projects with those in some C# projects.
(*
This script analyzes the dependencies between top level types in a .NET Assembly.
It is then used to compare the dependency relationships in some F# projects with those in some C# projects.
Note that no attempt has been made to optimize the code yet!
REQUIRES:
* Mono.Cecil for code analysis
From http://www.mono-project.com/Cecil#Download
@ToJans
ToJans / ewmath.ex
Last active December 20, 2015 17:59
My functional coding blurb
defmodule EWMath.Guidance do
@moduledoc """
This is the general guidance document for the module EwMath
"""
defmodule :'Getting started' do
@moduledoc """
This is a guidance that will walk you through blahaba
"""
#r @"..\packages\SharpDX.2.5.0\lib\net40\SharpDX.dll"
#r @"..\packages\SharpDX.Direct3D11.2.5.0\lib\net40\SharpDX.Direct3D11.dll"
#r @"..\packages\SharpDX.DXGI.2.5.0\lib\net40\SharpDX.DXGI.dll"
#r @"..\packages\SharpDX.Toolkit.2.5.0\lib\net40\SharpDX.Toolkit.dll"
#r @"..\packages\SharpDX.Toolkit.Game.2.5.0\lib\net40\SharpDX.Toolkit.Game.dll"
#r @"..\packages\SharpDX.Toolkit.Graphics.2.5.0\lib\net40\SharpDX.Toolkit.Graphics.dll"
open System
open SharpDX
open SharpDX.Toolkit