Skip to content

Instantly share code, notes, and snippets.

View SanthoshBabuMR's full-sized avatar
💫
Give me 6 hours to chop down a tree & I'll spend the first 4 sharpening the axe.

Santhosh Babu SanthoshBabuMR

💫
Give me 6 hours to chop down a tree & I'll spend the first 4 sharpening the axe.
View GitHub Profile
@SanthoshBabuMR
SanthoshBabuMR / table-row-selection.html
Last active October 24, 2017 18:15
Table/list row selection using 'click' / 'ctrl-click' / 'shift-click'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Table row click</title>
<style media="screen">
.ui-selectable-row-disable-text-selection {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
@SanthoshBabuMR
SanthoshBabuMR / .jsp
Created January 13, 2018 04:24
Print Version: Tomcat, Servlet, JSP
Server Version: <%= application.getServerInfo() %><br /><br />
Servlet Version: <%= application.getMajorVersion() %>.<%= application.getMinorVersion() %><br />
JSP Version: <%= JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion() %><br />
@SanthoshBabuMR
SanthoshBabuMR / merge_stmt.sql
Created April 2, 2020 14:21
MERGE statement(SQL)
-- Truncate tables
DROP table staging_members;
DROP table members;
-- Create members
CREATE TABLE members(
id number primary key,
first_name varchar(50) not null,
last_name varchar(50),
rank varchar(20)
@SanthoshBabuMR
SanthoshBabuMR / max_call_stack.js
Created April 13, 2020 03:46
maximum call stack size
// Ref: https://2ality.com/2014/04/call-stack-size.html
function computeMaxCallStackSize() {
try {
return 1 + computeMaxCallStackSize();
} catch (e) {
// Call stack overflow
return 1;
}
}
@SanthoshBabuMR
SanthoshBabuMR / java_find_data_type.java
Created April 14, 2020 02:10
Java - get data type
public class Main {
public static void main(String[] args) {
String name = "foo";
System.out.println(name); // foo
System.out.println(name.getClass()); // class java.lang.String
System.out.println(name.getClass().getName()); // java.lang.String
System.out.println(name.getClass().getSimpleName()); // String
}
}
// enum is private class with static final members
enum PersonType {
Men,
Women,
Transgender
}
class Person {
Person(String name, PersonType gender) {
this.name = name;
// https://leetcode.com/playground/otdz2h93
/*
Why?
- Readability
- Grouping of constants under one roof
- Compile Type Check
- Enumertion of values
- Unlike constants, we can store multiple values against a single enum type
apiVersion: v1
kind: Pod
metadata:
name: my-multi-container-pod
labels:
app: myapp
type: front-end
spec:
containers:
- name: nginx-container
apiVersion: v1
kind: Pod
metadata:
name: my-first-app-pod
labels:
app: myapp
type: front-end
spec:
containers:
- name: nginx-container
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp-rs
labels:
app: myapp
spec:
template:
metadata:
name: myapp-pod