Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View justinmchase's full-sized avatar
🤙

Justin Chase justinmchase

🤙
View GitHub Profile
@justinmchase
justinmchase / Design.cs
Last active August 29, 2015 14:11
Simple Composition Design
interface IObject
{
string Name { get; }
IObject Parent { get; }
void Add(string name, IComponent component);
void Add(IObject child);
void Remove(IObject child);
IComponent GetComponent(string name);
IEnumerable<IObject> GetChildren();
@justinmchase
justinmchase / Components.js
Last active August 29, 2015 14:11
A hypothetical compositional language
component c1 {
function receive(message: string) { // handles "receive" messages
print(message)
}
}
component c2 {
var running: bool
function run() { // Handles the "run" message
if(!running)
@justinmchase
justinmchase / Program.cs
Created May 28, 2015 19:10
Simple composition pattern
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication4
{
class Program
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "The AWS CloudFormation template for this Serverless application",
"Resources": {
"ServerlessDeploymentBucket": {
"Type": "AWS::S3::Bucket"
},
"CloudwatchUnderscoretoUnderscoreelasticsearchLogGroup": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
import { mapLimit, auto, constant } from 'async'
import request from 'request'
import analyzer from './analyze'
import logger from './log'
const data = [
'http://example.com/item/0'
'http://example.com/item/1'
'http://example.com/item/2'
'http://example.com/item/3'