Skip to content

Instantly share code, notes, and snippets.

Core Coding Standard

Coding practices are a source of a lot of arguments among programmers. Coding standards, to some degree, help us to put certain questions to bed and resolve stylistic debates. No coding standard makes everyone happy. (And even their existence is sure to make some unhappy.) What follows are the standards we put together on the Core team, which have become the general coding standard for all programming teams on new code development. We’ve tried to balance the need for creating a common, recognizable and readable code base with not unduly burdening the programmer with minor code formatting concerns.

Table Of Contents

using System;
using System.Data.SQLite;
namespace StringInterpolationSQL
{
class Program
{
private static SQLiteConnection connection;
static void Main(string[] args)
{
@atifaziz
atifaziz / Program.cs
Created July 24, 2015 15:59
Fun with String Interpolation in C# 6 to do SQL literal encoding
using System;
using System.Linq;
using static System.Console;
using static System.Globalization.CultureInfo;
static class Program
{
static void Main()
{
var count = 5;
@CarstenKoenig
CarstenKoenig / EventPlaybackApplicative.fs
Created February 13, 2015 07:59
playing back events with applicative projections
namespace Events
type Projection<'ev, 'state, 'out> =
{ foldState : 'ev -> 'state -> 'state
; projection : 'state -> 'out
; emptyState : 'state
}
module Projections =
exception ItemAlreadyExists of string
exception ItemNotFound of string
exception DomainError of string
type Command =
| CreateInventoryItem of Id: int
| RenameInventoryItem of Id: int * Name: string
| RemoveItemsFromInventory of Id: int * Amount: int
| AddItemsToInventory of Id: int * Amount: int
| DeactivateInventoryItem of Id: int
@ToJans
ToJans / InventoryItems.hs
Last active January 19, 2024 10:47
Haskell implementation of Greg Young's CQRS sample: https://github.com/gregoryyoung/m-r Love the sheer elegance of Haskell; no need for all that infrastructure crap
module InventoryItems(Command(..), Event(..), handle) where
import Data.Maybe(isJust)
type Id = String
type Name = String
type Amount = Int
data Command = CreateInventoryItem Id
| RenameInventoryItem Id Name
@labeneator
labeneator / alpr.py
Last active July 19, 2019 14:45
alpr.py - Automatic number plate recognition
#! /usr/bin/env python
import cv2
import numpy as np
import pymeanshift as pms
from blobs.BlobResult import CBlobResult
from blobs.Blob import CBlob # Note: This must be imported in order to destroy blobs and use other methods
@jonashaag
jonashaag / 0-howto-listfield-django-admin.rst
Created September 7, 2011 09:41
Howto use ListFields in Django's admin

Howto use ListFields in Django's admin

Problem

Consider this blog post model:

models.py

: