Skip to content

Instantly share code, notes, and snippets.

Kim Kangho cimfalab

  • ab
Block or report user

Report or block cimfalab

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View javascript-static-analysis-tools.md

JavaScript Static Analysis Tools

Most people are familiar with these three tools:

  1. [JSHint][1]
  2. [JSLint][2]
  3. [Google Closure Linter][3]

The first one is more popular among developers because it is style-agnostic. The other two enforce rules of [Crockford Style][4] and [Google Code Style][5] respectively.

@cimfalab
cimfalab / webPageTestPoller.js
Last active Aug 12, 2017
webPageTestPoller.js
View webPageTestPoller.js
WebPageTestPoller.prototype.poll = function() {
WebPageTestPoller.super_.prototype.poll.call(this);
this.debug('WebPageTest start test [target='+this.target+']');
this.wpt.runTest(this.target, config.webPageTest.testOptions | {}, this.onTestStartedCallback.bind(this));
};
View alert.js
notificationReceived: function(notification, payload, sender) {
if (notification === "SHOW_ALERT") {
if (typeof payload.type === "undefined") { payload.type = "alert"; }
if (payload.type == "alert") {
this.show_alert(payload, sender);
} else if (payload.type = "notification") {
this.show_notification(payload);
}
} else if (notification === "HIDE_ALERT") {
this.hide_alert(sender);
View vb.js
function dedent(_stream, state) {
state.currentIndent--;
}
function tokenLexer(stream, state) {
...
if (indentInfo === 'dedent') {
if (dedent(stream, state)) {
return ERRORCLASS;
}
View popup.alignment.js
_getAlignment: function() {
var ar, align;
if ( this.options.align ) {
ar = this.options.align.split( "," );
}
if ( ar && ar.length > 0 ) {
align = {
x: parseFloat( ar[ 0 ] ),
View HTMLInstrumentation.js
function _getMarkerAtDocumentPos(editor, pos, preferParent, markCache) {
var marks, match;
markCache = markCache || {};
marks = _getSortedTagMarks(editor._codeMirror.findMarksAt(pos), markCache);
if (!marks.length) {
return null;
}
// The mark with the latest start is the innermost one.
View serverValidator.js
loadRecommendationsSuccess: function(data) {
if (!data) {
console.warn('error while loading default config values');
}
this._saveRecommendedValues(data);
var configObject = data.resources[0].recommendations.blueprint.configurations;
if (configObject) this.updateInitialValue(configObject);
this.set("recommendationsConfigs", Em.get(data.resources[0] , "recommendations.blueprint.configurations"));
},
@cimfalab
cimfalab / markdown.js
Last active Aug 11, 2017
markdown.js
View markdown.js
function addAttributes( section, element, previousElement, separatorElementAttributes, separatorSectionAttributes ) {
if ( element != null && element.childNodes != undefined && element.childNodes.length > 0 ) {
previousParentElement = element;
for( var i = 0; i < element.childNodes.length; i++ ) {
childElement = element.childNodes[i];
...
}
}
View main.js
UrlCodeHints.prototype._getUrlList = function (query) {
...
if (this.cachedHints) {
// use cached hints
unfiltered = this.cachedHints.unfiltered;
} else {
directory = FileSystem.getDirectoryForPath(targetDir);
self = this;
@cimfalab
cimfalab / bulk_operations_controller.js
Last active Aug 11, 2017
bulk_operations_controller.js
View bulk_operations_controller.js
_getComponentsFromServerForHostComponentsDecommissionCallBack: function (operationData, data) {
...
if (components.length) {
...
if (turn_off) {
// For recommession
if (svcName === "YARN" || svcName === "HBASE" || svcName === "HDFS") {
App.router.get('mainHostDetailsController').doRecommissionAndStart(hostNames, svcName, masterName, slaveName);
}
} else {
You can’t perform that action at this time.