Skip to content

Instantly share code, notes, and snippets.

View andrewbranch's full-sized avatar

Andrew Branch andrewbranch

View GitHub Profile

Strict Environment

Problem Statement

Strict Environment is intended to address three distinct problems that are frequently encountered by TypeScript developers.

This is an alternative approach to solving the problems that placeholder types were intended to address.

Problem 1: Augmentation Pollution

@rbuckton
rbuckton / ts-proposal-range-types.md
Last active November 7, 2023 19:10
Proposal: Range Types for TypeScript

Range Types (T[X:Y]) for TypeScript

A Range Type is a type that produces a new tuple or array type that derives from T by dropping the excess ordered elements of T outside of the range starting at offset X (inclusive) through offset Y (exclusive).

A Range Type is denoted using a : operator in what would otherwise be an Indexed Access Type:

type T = [1, 2, 3][0:2];

Core Priorities

Briefly state your (2-5) core priorities that represent your primary areas of focus and the targeted business impact. Also include your critical indicators of success for each

  1. Lower the barrier of entry to adopting and understanding TypeScript. Will validate by re-requesting feedback from the community a second time like issues #31983 and hopefully it should be a new set of problems.

  2. Provide resources for people wanting to improve the TypeScript community. Validated by seeing more meetups, conferences rely on infra we provide.

  3. Make it easier to people wanting to build tooling around TypeScript. Some of this can be think this can be validated by making a community survey and comparing to internal feedback. I have some personal docs, and ideas in the website overview but would be good to get overall ideas.

@smockle
smockle / merge_workflow.sh
Last active March 15, 2017 11:57
Merging a feature branch into master
hub push
hub checkout master
hub pull
hub checkout <feature_branch>
hub pull-request -m "description"
hub checkout master
hub merge <pr_url>
hub push
hub push origin :<feature_branch>
hub branch -d <feature_branch>

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@smockle
smockle / VMwareFusion.md
Last active August 29, 2015 14:03
Key mappings for VMware Fusion. (Windows guests; Mac hosts)

Fusion Shortcuts

Uncheck ⌘-Q

Key Mappings

Mac Shortcut Virtual Machine Shortcut
⌘-Z Control-Z
⌘-X Control-X
@smockle
smockle / iis.md
Created October 29, 2013 18:04
Use custom domains in IIS.
  1. Open %USERPROFILE%\My Documents\IISExpress\config\applicationhost.config
  2. Search for "virtualDirectory".
  3. Append <binding protocol="http" bindingInformation="*:<port>:dev.example.com" /> to the bindings section.
  4. In an admin terminal, run netsh http add urlacl url=http://dev.example.com:<port>/ user=everyone
  5. Open %SystemRoot%\system32\drivers\etc\hosts as an admin.
  6. Append 127.0.0.1 dev.example.com to the hosts file.
@andrewbranch
andrewbranch / ErrorsController.cs
Last active December 18, 2015 02:18
Files (or snippets of files) to set up a highly flexible custom errors system that works for jQuery AJAX and synchronous calls alike for an ASP.NET MVC project.
using System.Net;
using System.Web.Mvc;
namespace ProjectName.Controllers
{
public class ErrorController : Controller
{
public ViewResult NotFound() {
Response.StatusCode = (int)HttpStatusCode.NotFound;
@troystribling
troystribling / gist:2491439
Created April 25, 2012 17:18
Objective C Array Map
@interface NSArray (Extensions)
- (NSArray *)mapObjectsUsingBlock:(id (^)(id obj, NSUInteger idx))block;
@end
@implementation NSArray (Extensions)
- (NSArray *)mapObjectsUsingBlock:(id (^)(id obj, NSUInteger idx))block {
NSMutableArray *result = [NSMutableArray arrayWithCapacity:[self count]];
@christophermanning
christophermanning / README.md
Last active March 30, 2023 04:24
Voronoi Diagram with Force Directed Nodes and Delaunay Links

Created by Christopher Manning

Summary

Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.

The white lines are the Delaunay triangulation and the purple cells are the Voronoi diagram.

Controls