Skip to content

Instantly share code, notes, and snippets.

View burntblark's full-sized avatar

Familusi Babatunde burntblark

View GitHub Profile
@burntblark
burntblark / truncate
Created January 26, 2017 11:29
List of tables to safely truncate on Magento CE v 1.x
TRUNCATE dataflow_batch_export;
TRUNCATE dataflow_batch_import;
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
@burntblark
burntblark / MySQL Database Size
Last active February 6, 2017 05:17
Checking the current size of your MySQL Databases
SELECT table_schema "DB Name", Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema;
// Remove column(s) from a collection
db.collection.update(
{},
{ $unset:
{
field:1
}
} , {
multi: true
}
@burntblark
burntblark / titlecase-input.directive.ts
Created November 16, 2018 16:35
An Angular Attribute Directive to ensure title cases.
import { Directive, ElementRef, forwardRef, Renderer2, HostListener } from '@angular/core';
import { NG_VALUE_ACCESSOR, DefaultValueAccessor } from '@angular/forms';
const TITLECASE_INPUT_CONTROL_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => TitlecaseInputDirective),
multi: true,
};
@Directive({