Skip to content

Instantly share code, notes, and snippets.

View abhididdigi's full-sized avatar
🔥

Abhiram Diddigi abhididdigi

🔥
View GitHub Profile
@abhididdigi
abhididdigi / writing-eslint-rule.md
Created August 5, 2019 04:03 — forked from sindresorhus/writing-eslint-rule.md
Gettings started writing a ESLint rule

Gettings started writing a ESLint rule

First, take a look at the ESLint rule documentation. Just skim it for now. It's very long and boring. You can come back to it later.

ESLint rules works on the AST (Abstract Syntax Tree) representation of the code. In short, this is a tree structure that describes the code in a very verbose form. ESLint walks this tree and rules can subscribe to be notified when it hits a specific node type, like a Literal type, which could be the "hello" part of const welcome = "hello";.

Go ahead and play around with some code in AST Explorer (Make sure the parser is espree). It's a great tool!

Here are some good articles on the subject (ignore the scaffolding parts):

// it expects the following , and if not present, will send out an error.
// msg should have the following properties : table_name, sys_id, column_mapping,column_name.
var POST_Attachment = Class.create();
POST_Attachment.prototype = {
initialize: function(msg) {
this.body = msg;
this.table_name = msg["table_name"];
this.key = msg["key"];
var MomentJS = Class.create();
MomentJS.moment = //! moment.js
//! version : 2.17.1
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
(function () { 'use strict';
var hookCallback;
var OB_JV_UserCreationUtil = Class.create();
OB_JV_UserCreationUtil.prototype = {
initialize: function(blob,subject) {
this.blob = blob;
this.controller = new OB_IntegrationController();
this.subject = subject;
this.personal_email_id = x_4591_jobvite_can.OB_JobviteConstants.getPattern(blob,"email");
this.controller = new OB_IntegrationController();
},
insertUser:function(){
var OB_JV_UserCreationUtil = Class.create();
OB_JV_UserCreationUtil.prototype = {
initialize: function(blob,subject) {
this.blob = blob;
this.controller = new OB_IntegrationController();
this.subject = subject;
this.personal_email_id = x_4591_jobvite_can.OB_JobviteConstants.getPattern(blob,"email");
this.controller = new OB_IntegrationController();
},
insertUser:function(){
var OB_JV_UserCreationUtil = Class.create();
OB_JV_UserCreationUtil.prototype = {
initialize: function(blob,subject) {
this.blob = blob;
this.controller = new OB_IntegrationController();
this.subject = subject;
this.personal_email_id = x_4591_jobvite_can.OB_JobviteConstants.getPattern(blob,"email");
this.controller = new OB_IntegrationController();
},
@abhididdigi
abhididdigi / JSON.js
Last active January 10, 2016 07:37
JSON2.js Modification of JSON2.js for ServiceNow.
/*
JSON22.js
2015-05-03
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
See http://www.JSON.org/js.html
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:set_if test="${sysparm_cartless}" var="jvar_cart_style" true="display:none" />
<table style="float: right">
<tr>
<td id="cart" style="${jvar_cart_style}"></td>
</tr>
</table>
@abhididdigi
abhididdigi / casper_scrapping.js
Last active August 29, 2015 14:12
Scrapping Topcoder with CasperJS
var casper = require('casper').create();
var startID = 1964;
var endID = 13533;
casper.start();
while (startID <= endID) {
scrapPages(startID);
startID++;
}
function scrapPages(i) {
/**
* A wrapper class to hold meta data about a column in a table
*/
var ColumnInfo = Class.create();
ColumnInfo.prototype= {
setValues: function(reference, internalName, name, table, internalType, typeName, referenceName, sysID, nLength) {
this.reference = reference;
this.internalName = internalName;