Skip to content

Instantly share code, notes, and snippets.

View lloydjatkinson's full-sized avatar
🌧️
Chilling

Lloyd Atkinson lloydjatkinson

🌧️
Chilling
View GitHub Profile
@laurakelly
laurakelly / index.html
Last active January 24, 2024 15:01
Connecting Two Points with a Line in D3.js
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="graph">
<h1>Connecting Two Points with a Line in D3.js</h1>
</div>
@addyosmani
addyosmani / README.md
Last active April 6, 2025 09:15 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@davidfowl
davidfowl / dotnetlayout.md
Last active April 14, 2025 07:13
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@vkhorikov
vkhorikov / CustomerController.cs
Last active July 30, 2024 14:25
Handling failures and input errors in a functional way
[HttpPost]
public HttpResponseMessage CreateCustomer(string name, string billingInfo)
{
Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo);
Result<CustomerName> customerNameResult = CustomerName.Create(name);
return Result.Combine(billingInfoResult, customerNameResult)
.OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value))
.OnSuccess(() => new Customer(customerNameResult.Value))
.OnSuccess(
@DanielSWolf
DanielSWolf / Program.cs
Last active March 21, 2025 16:29
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
public abstract class Error
{
public abstract ErrorType Type { get; }
}
public class SimpleError : Error
{
public override ErrorType Type { get { return ErrorType.Simple; } }
public string Message { get; private set; }
@tim-elvidge
tim-elvidge / Concrete Controller
Last active January 8, 2021 10:07
Generic Mediator Pattern for Data Handling
public partial class AuctionUsersController : WebCommon.Controllers.DapperGridController<Domain.AuctionModels.UserDto>
{
public AuctionUsersController(IDbInterface mediatorInjection)
{
base.DbMediator = mediatorInjection;
}
public virtual ActionResult Index()
{
return View();
}
@Medeah
Medeah / elevator.ts
Created September 17, 2015 19:29
simple elevator logic. with typeScript type definitions
var elevatorSaga = {
init: function(elevators: Elevator[], floors: Floor[]) {
console.log(floors[1]);
function amin(numArray) {
return Math.min.apply(null, numArray);
}
function amax(numArray) {
return Math.max.apply(null, numArray);
}
/**
@callumlocke
callumlocke / README.md
Created October 26, 2015 14:38
Importing individual lodash-es functions
import chunk from 'lodash-es/array/chunk';
import zipObject from 'lodash-es/array/zipObject';

console.log(zipObject(chunk(['a', 'b', 'c', 'd'], 2)));
$ rollup -f=iife demo.js > output.js
@CodeMyUI
CodeMyUI / christmas-lights.markdown
Created December 28, 2016 01:14
Christmas lights