Skip to content

Instantly share code, notes, and snippets.

View rahulmalhotra's full-sized avatar
😃
Working on something amazing...!!

Rahul Malhotra rahulmalhotra

😃
Working on something amazing...!!
View GitHub Profile
----------------------------------------------------------------------------------------------------------------------------
To add eslint :-
1. npm install -g eslint
2. add .eslintsrc to main project directory of react-native project
3. add this code to .eslintsrc -
{
"extends": "rallycoding"
}
4. npm install --save-dev eslint-config-rallycoding
5. In sublime text install package "Sublime Linter" and "sublimelinter-contrib-eslint"
@rahulmalhotra
rahulmalhotra / InsertionSortTurbo.cpp
Last active November 26, 2017 03:21
Insertion Sort Turbo C++ Code
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int size,arr[50],j=0,store;
cout<<"\n\nEnter the size of the Array";
cin>>size;
cout<<"\n\nEnter the array";
for(int i=1;i<=size;i++)
@rahulmalhotra
rahulmalhotra / InsertionSortCodeBlocks.cpp
Created November 26, 2017 03:22
Insertion Sort code compatible with Codeblocks IDE
#include<iostream>
using namespace std;
int main()
{
int size,arr[50],j=0,store;
cout<<"\n\nEnter the size of the Array";
cin>>size;
cout<<"\n\nEnter the array";
for(int i=1;i<=size;i++)
{
@rahulmalhotra
rahulmalhotra / 1DArray.java
Created November 26, 2017 03:30
Program to create 1-D Array in Java
public class array {
public static void main(String[] args) {
int months[]={1,2,3,4,5,6,7,8,9,10,11,12};
System.out.println("Months - ");
for(int i=0;i<12;i++)
System.out.println(months[i]);
}
}
@rahulmalhotra
rahulmalhotra / 1DArrayNew.java
Last active November 26, 2017 03:34
Program to make 1-D Array using new keyword in java
public class array {
public static void main(String[] args) {
String name[]=new String[3];
name[0]="Rahul ";
name[1]="Malhotra ";
name[2]="is a coder";
System.out.println(name[0]+name[1]+name[2]);
}
}
@rahulmalhotra
rahulmalhotra / 2DArray.java
Created November 26, 2017 03:37
Java program to create 2-D array using new keyword.
public class array {
public static void main(String[] args) {
int m[][]=new int[2][2];
for(int i = 0;i<2;i++)
{
for(int j=0;j<2;j++)
{
m[i][j]=i+j+1;
System.out.println(m[i][j]);
}
@rahulmalhotra
rahulmalhotra / 2DArrayNew.java
Created November 26, 2017 03:41
Java program to make 2-D Array with different columns for each row.
public class array {
public static void main(String[] args) {
int m1[][]=new int[2][];
m1[0]=new int[1];
m1[1]=new int[2];
m1[0][0]=1;
//m1[0][1]=2;
m1[1][0]=3;
m1[1][1]=4;
System.out.println(m1[0][0]);
@rahulmalhotra
rahulmalhotra / 2DArrayNewDirect.java
Created November 26, 2017 03:50
Java program to make 2-D array without using new keyword
public class array {
public static void main(String[] args) {
int m2[][]={{1},{1,2},{1,2,3}};
System.out.println(m2[0][0]);
//System.out.println(m2[0][1]);
//System.out.println(m2[0][2]);
System.out.println(m2[1][0]);
System.out.println(m2[1][1]);
//System.out.println(m2[1][2]);
System.out.println(m2[2][0]);
@rahulmalhotra
rahulmalhotra / pmdsamplecommandcustomrules.cls
Created December 16, 2017 15:41
PMD cmd sample command using custom rule
pmd -d "C:\Users\Rahul Malhotra\Documents\My Lightning Org\src\classes\test.cls" -f html -R "F:\Program Files (x86)\pmd-bin-6.0.0\Ruleset\myrules.xml" -reportfile output.html
@rahulmalhotra
rahulmalhotra / pmdsamplecommanddefaultrules.cls
Created December 16, 2017 15:42
PMD sample command with default rules
pmd -d "C:\Users\Rahul Malhotra\Documents\My Lightning Org\src\classes" -f html -R category/apex/design.xml/ExcessiveParameterList -reportfile output.html