Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ranjit ranjitiyer

🎯
Focusing
View GitHub Profile
View gist:a056da16a7da95a3e4aba96bc2a73404
> help
** command list **
connectors -- list available connectors and transports in this VM
run [class [args]] -- start execution of application's main class
threads [threadgroup] -- list threads
thread <thread id> -- set default thread
suspend [thread id(s)] -- suspend threads (default: all)
resume [thread id(s)] -- resume threads (default: all)
View gist:d021a28bb15bd8fe6986d18d623be0b5
basic 'find file' commands
--------------------------
find / -name foo.txt -type f -print # full command
find / -name foo.txt -type f # -print isn't necessary
find / -name foo.txt # don't have to specify "type==file"
find . -name foo.txt # search under the current dir
find . -name "foo.*" # wildcard
find . -name "*.txt" # wildcard
find /users/al -name Cookbook -type d # search '/users/al' dir
@ranjitiyer
ranjitiyer / elastic-search-queries
Last active Nov 15, 2017
Elastic Search Cheat Sheet
View elastic-search-queries
# Delete docs that do not exactly match a phrase
POST audiobooks/book/_delete_by_query
{
"query": {
"bool": {
"must_not": [
{"match_phrase": {
"language": "English"
}}
]
@ranjitiyer
ranjitiyer / pom.xml
Created Nov 10, 2017
Create Maven fat jar
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.amazon</groupId>
<artifactId>spark</artifactId>
<version>1.0-SNAPSHOT</version>
@ranjitiyer
ranjitiyer / spiritualQuote.js
Created Nov 6, 2017
Alexa skill for your daily spiritual quote
View spiritualQuote.js
/* eslint-disable func-names */
/* eslint-disable dot-notation */
/* eslint-disable new-cap */
/* eslint quote-props: ['error', 'consistent']*/
/**
* This sample demonstrates a simple skill built with the Amazon Alexa Skills
* nodejs skill development kit.
* This sample supports en-US lauguage.
* The Intent Schema, Custom Slots and Sample Utterances for this skill, as well
* as testing instructions are located at https://github.com/alexa/skill-sample-nodejs-trivia
View ExceptionUtils.java
public class ExceptionUtils {
public static String stackTraceAsString(Exception ex) {
if (ex == null) {
return "";
}
return Arrays.asList(ex.getStackTrace())
.stream()
.reduce(
new StringBuilder(),
View CommonsCmdParser.java
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main (String[] args) throws java.lang.Exception