Skip to content

Instantly share code, notes, and snippets.

View dileeph's full-sized avatar

Dileep Hareendran dileeph

View GitHub Profile
@dileeph
dileeph / aws_scanner.sh
Created March 14, 2025 18:53
aws resources scanner. takes credentials from aws config
#!/bin/bash
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
# Create output directory with timestamp
@dileeph
dileeph / QueryBuilderTest.java
Last active February 27, 2018 12:50
Query builder test
import java.io.IOException;
import org.junit.Test;
public class QueryBuilderTest {
@Test
public void testQB() {
String sql = "select x from ";
@dileeph
dileeph / Query.java
Last active February 26, 2018 15:27
Query class
package com.my.crawler;
import java.util.Map;
public class Query {
private Map<String, Object> parameterMap;
private String queryString;
@dileeph
dileeph / QueryBuilder.java
Last active February 26, 2018 15:54
build query using java 8 features
package com.my.crawler;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
public class QueryBuilder {
private Map<String, Object> parameterMap = new HashMap<>();
@dileeph
dileeph / scriptlet
Last active January 22, 2018 11:27
final Pattern scriptletstartreg = Pattern.compile("<%[^-|@]");
final Pattern scriptletendreg = Pattern.compile("[^-]%>");
final List<Scriptlet> scripts = new ArrayList<>();
//--start else--//
//--current code --//
currentPageTldPrefix.keySet().forEach(key -> {
Pattern regexForEachTagPrefixPattern = Pattern.compile(key);
import java.util.AbstractMap.SimpleEntry;
import java.util.Collections;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class TagPatterns {
public static Map<PatternKey, String> tagdirectiveURLPatternMap() {
@Override
public void visit(ClassOrInterfaceDeclaration n, Struts2InputOutput io) {
// System.out.println("Name of class: " + n.getn.getName());
final StringBuilder fullClassName = new StringBuilder();
final List<ImportDeclaration> imports = new ArrayList<>();
n.getParentNode().ifPresent(parent -> {
((CompilationUnit) parent).getPackageDeclaration()
.ifPresent(packageName -> fullClassName.append(packageName.getNameAsString()));
imports.addAll(((CompilationUnit) parent).getImports());
});
@dileeph
dileeph / Gruntfile.js
Created June 16, 2017 19:34
grunt bower file
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
"bower-install-simple": {
options: {
color: true,
directory: "lib"
},
@dileeph
dileeph / bower.json
Created June 16, 2017 19:29
bower json
{
"name": "app1",
"description": "",
"main": "",
"authors": [
"dileep"
],
"private": true,
"dependencies": {
"angular": "1.4.8"
@dileeph
dileeph / grunt-sample1-code.html
Created June 16, 2017 19:09
grunt-sample1-code
==== app.js -=======
var app = angular.module("app",["module1", "module2"]);
=== module-1.js ================
var module1 = angular.module("module1",[]);
module1.controller("controllerOne",["$scope", function($scope){
$scope.name = "Matt";
}]);