Skip to content

Instantly share code, notes, and snippets.

View KevinTCoughlin's full-sized avatar

Kevin Coughlin KevinTCoughlin

View GitHub Profile
@KevinTCoughlin
KevinTCoughlin / async.js
Created April 24, 2018 22:19
Fabric Async.ts Memory Leak
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Bugs often appear in async code when stuff gets disposed, but async operations don't get canceled.
* This Async helper class solves these issues by tying async code to the lifetime of a disposable object.
*
* Usage: Anything class extending from BaseModel can access this helper via this.async. Otherwise create a
* new instance of the class and remember to call dispose() during your code's dispose handler.
*
* @public
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
--log_gc (Log heap samples on garbage collection for the hp2ps tool.)
type: bool default: false
--expose_gc (expose gc extension)
type: bool default: false
--max_new_space_size (max size of the new generation (in kBytes))
type: int default: 0
--max_old_space_size (max size of the old generation (in Mbytes))
type: int default: 0
--max_executable_size (max size of executable memory (in Mbytes))
type: int default: 0
@KevinTCoughlin
KevinTCoughlin / gist:80e4094cbf092e102208289ec4455120
Created September 20, 2017 03:26
Walmart Mobile node.js Setup

Overview

We run multiple server processes in two data centers. Each process listens on two ports, one for HTTP and one for HTTPS. HTTPS is terminated by Apache prior to reaching node.js. HTTP goes directly from the client to node.js (through a master load balancer). We do not use clusters. We slice our physical servers into thin virtual machines running SmartOS, each with about 3GB of memory designed for a single node.js process.

Our node.js servers are hapi.js servers using the composer functionality and plugins architecture. We have three sets of plugins loaded: mobile web front end experience (single page app), legacy API reverse proxy, and monitoring.

We also serve original node.js services off another server zone which runs closed source plugins using hapi.

Analytics

@KevinTCoughlin
KevinTCoughlin / README.md
Created July 30, 2017 02:51 — forked from vanto/README.md
OEmbed Liquid Tag for Jekyll

OEmbed Liquid Tag for Jekyll

This is a simple liquid tag that helps to easily embed images, videos or slides from OEmbed enabled providers. It uses Magnus Holm's great oembed gem which connects to the OEmbed endpoint of the link's provider and retrieves the HTML code to embed the content properly (i.e. an in-place YouTube player, Image tag for Flickr, in-place slideshare viewer etc.). By default it supports the following OEmbed providers (but can fallback to Embed.ly or OoEmbed for other providers):

  • Youtube
  • Flickr
  • Viddler
  • Qik
  • Revision3
  • Hulu
  • Vimeo
@KevinTCoughlin
KevinTCoughlin / tasks.json
Created July 4, 2017 03:51
VSCode tasks.json for jekyll development
{
"version": "0.1.0",
"command": "bundle",
"isShellCommand": true,
"args": ["exec", "jekyll"],
"showOutput": "always",
"echoCommand": true,
"suppressTaskName": true,
"tasks": [
{

Keybase proof

I hereby claim:

  • I am KevinTCoughlin on github.
  • I am kevincoughlin (https://keybase.io/kevincoughlin) on keybase.
  • I have a public key whose fingerprint is FD4A 6268 B6C5 9A8F 70B1 4C68 F26F 4CEB 4B9F 3390

To claim this, I am signing this object:

@KevinTCoughlin
KevinTCoughlin / jekyll-and-liquid.md
Created April 28, 2017 03:15 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@KevinTCoughlin
KevinTCoughlin / web.config
Created April 12, 2017 20:06
Default Web Config
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
Using *:empty to Troubleshoot Your CSS
Nicole Ramsey is a freelance developer for An Event Apart and QA Lead for Modern Tribe. She still views source when possible, wishes she could remember all shortcuts without a cheat sheet, and fusses with her dotfiles more than is necessary. Here, she shares a CSS troubleshooting tip:
One of the simplest, but most useful, tools in my QA toolkit is the *:empty pseudo selector. This selector affects elements that contain either nothing or only an HTML comment. Caveats: This won’t catch elements if there is whitespace and it will false-positive catch <img> elements.
Example
*:empty {border: 5px solid red;}
<p>Awesome content</p>