Skip to content

Instantly share code, notes, and snippets.

View Jeff-Lewis's full-sized avatar

Jeff Lewis Jeff-Lewis

  • StreetConnect & SchoolBee
  • NYC
View GitHub Profile
.
├── matree
├── swift
│   ├── 00503_0_254.242_2013mar02
│   ├── 00546_0_ensbdasa-09aug2013
│   ├── 00553_0_ensbdpix3-09aug2013
│   ├── 00554_0_ensbdpix4-09aug2013
│   ├── 00555_0_ensbdrtr1-2013aug09
│   ├── 00557_0_ENSBDVPN1-02AUG2013
│   ├── 00558_0_ENSBDVPN2-02AUG2013
@Jeff-Lewis
Jeff-Lewis / ConsoleBufferToHtml.ps1
Created March 24, 2017 05:08 — forked from devlead/ConsoleBufferToHtml.ps1
ConsoleBufferToHtml.ps1 - Powershell script to dump console buffer as html to file.
<#
.SYNOPSIS
This is a Powershell script to dump console buffer as html to file.
.DESCRIPTION
This Powershell script will iterate over the current console buffer and
output it as html preserving colors.
.PARAMETER FilePath
SELECT
o.name as 'TableName' ,
SUM (
CASE
WHEN (index_id < 2) THEN row_count
ELSE 0
END
) as 'RowCount',
LTRIM (STR (SUM (reserved_page_count)/1024 * 8, 15, 0) + ' MB') as'Reserved MB',
/* @flow */
declare module 'dynamoose' {
declare type Throughput = number | ({
read: number;
} | {
write: number;
});
declare type ThroughputConfig = {
throuput: Throughput;
// Custom made dynamoose declaration file.
declare module "dynamoose" {
export function local(url: string): void;
export function model<DataSchema, KeySchema, ModelSchema extends Model<DataSchema>>(
modelName: string,
schema: Schema,
options?: ModelOption
): ModelConstructor<DataSchema, KeySchema, ModelSchema>;
export function setDefaults(options: ModelOption): void;
@Jeff-Lewis
Jeff-Lewis / Readme.txt
Created December 5, 2016 15:37
Windows_Server_Copy_Disk_Cleanup
Simple Disk Cleanup Server "Fix" v. 1.1
Date: 5.12.2014
http://www.null-byte.org/development/missing-disc-cleanup-utility-in-windows-server-fix/
Simple batch script to copy Windows Disk Cleanup tools without the need to install the full Desktop experience on a server, which also requires a reboot.
The script will attempt to detect the operating system and copy the required files (2) to the correct folder. A prompt to execute has been added in the end.
Usage:
1) Extract contents of the ZIP file to the servers local disk (Any location works, except UNC paths)
2) Execute script with Admin privileges if you have UAC enabled
@Jeff-Lewis
Jeff-Lewis / mongoDbHelpers.js
Created November 12, 2016 23:10
MongoDB helper for storing logged events and errors with circular or odd field names.
'use strict';
var _ = require('lodash');
/**
* Prepares metadata to store into database.
* @param {*} obj Metadata
* @return {*}
*/
module.exports.prepareData = function prepareData (obj) {
@Jeff-Lewis
Jeff-Lewis / wordpress-plugin-svn-to-git.md
Created November 11, 2016 21:47 — forked from kasparsd/wordpress-plugin-svn-to-git.md
Using Git with Subversion Mirroring for WordPress Plugin Development
@Jeff-Lewis
Jeff-Lewis / mongooseUniquenessValidation.js
Created August 25, 2016 22:28 — forked from edinella/mongooseUniquenessValidation.js
Mongoose uniqueness validator, case-sensitive or not
// context
var mongoose = require('mongoose');
mongoose.connect('mongodb://...');
/**
* Generates Mongoose uniqueness validator
*
* @param string modelName
* @param string field
* @param boolean caseSensitive
@Jeff-Lewis
Jeff-Lewis / domain-postmortem.md
Created August 8, 2016 18:41
node domain postmortem

domain Module Postmortem

Usability Issues

Implicit Behavior

It's possible for a developer to create a new domain and then simply run domain.enter(). Which then acts as a catch-all for any exception in the future that couldn't be observed by the thrower. Allowing a module author to intercept the exceptions of unrelated code in a different module. Preventing