Skip to content

Instantly share code, notes, and snippets.

View anthonynichols's full-sized avatar

Anthony Nichols anthonynichols

  • Udemy
  • Austin, TX
View GitHub Profile
@anthonynichols
anthonynichols / lib.es2017.object.d.ts
Last active December 31, 2019 18:21
Type definition for `Object` in Javascript with missing `Object.entries` definition
declare interface ObjectConstructor {
/**
* Returns an array of values of the enumerable properties of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
values<T>(o: { [s: string]: T } | ArrayLike<T>): T[];
/**
* Returns an array of values of the enumerable properties of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
@anthonynichols
anthonynichols / .gitignore
Created September 25, 2018 16:30
Default .gitignore file
# ==============================================================================
# MacOS
# ==============================================================================
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
@anthonynichols
anthonynichols / .phoenix.js
Last active March 8, 2019 16:37
Phoenix (Mac windows manager) config
// -----------------------------------------------------------------------------
// full screen: width 100%, height 100%
// -----------------------------------------------------------------------------
function fullScreen() {
let window = Window.focused();
if (window) {
let screen = window.screen().flippedVisibleFrame();
window.setTopLeft({
@anthonynichols
anthonynichols / tslint.json5
Last active July 28, 2018 22:03
TSLint config
{
"defaultSeverity": "error",
"rules": {
// -------------------------------------------------------------------------
// TypeScript specific
// -------------------------------------------------------------------------
// https://palantir.github.io/tslint/rules/adjacent-overload-signatures/
"adjacent-overload-signatures": true,
// https://palantir.github.io/tslint/rules/ban-types/
"ban-types": false,
@anthonynichols
anthonynichols / javascriptreact.json
Created February 23, 2018 16:30
React Snippets
{
/*
// Place your snippets for JavaScript React here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
// Coins
const COINS = [25, 10, 5, 1]
const TOTAL = 18
let storedValues = new Map()
function minCoins(coins, total) {
let coinsUsed = getCoinsUsedInTotal(coins, total)
import fs from 'fs-extra'
import _ from 'lodash'
import path from 'path'
let componentsPath = path.resolve('src/components')
const contents = fs.readdirSync(componentsPath)
let _files = []
let _directories = []