Skip to content

Instantly share code, notes, and snippets.

View xmlking's full-sized avatar
🌝
Write code that will last longer than You

Sumanth Chinthagunta xmlking

🌝
Write code that will last longer than You
View GitHub Profile
@xmlking
xmlking / async-generator-example.ts
Created February 24, 2019 00:22
async generator example
// @ts-ignore
const fetch = require('node-fetch');
function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function* getBooksPaged({ q, pageSize, lastPageIndex }) {
let currentIndex = 0;
let isDone = false;
@xmlking
xmlking / asciinema-svg-term.md
Last active September 8, 2018 20:23
How to screen record your terminal?

Guide to setup tools to record your terminal and share.

  1. Install asciinema
# install asciinema with
brew install asciinema
# start recording with:
asciinema rec
# to finish hit Ctrl-D or type exit.
# start recording to a file
@xmlking
xmlking / kubernetes.md
Last active November 12, 2022 11:56
Kubernetes Cheat Sheet

Kubernetes

Install

Prerequisites

  1. Bash v5+ checkout Upgrading Bash on macOS
  2. bash-completion@2

Install Docker and Kubernetes(k8s)

@xmlking
xmlking / README.md
Last active February 14, 2018 01:33

What

Implementation of tree data structure in TypeScript

Why

  1. How to search a node in Navigation menu tree?
  2. how to find all ancestors for a given node?
  3. Iterable interface for tree data structure

Usage

@xmlking
xmlking / Request.kt
Created January 2, 2018 04:15
Kotlin data class with second constructor !
@NoArg
@JsonIgnoreProperties(ignoreUnknown = true)
data class Request(
var AAA: String?,
var BBB : String?,
var CCC: String?
) {
constructor(raw: String): this(null,null, null) {
val mapper = jacksonObjectMapper()
val request = mapper.readValue<Request>(raw)
@xmlking
xmlking / docker-compose.yml
Last active March 24, 2023 01:12
cassandra healthcheck and dependency for docker compose
version: '2.1'
services:
cassandra:
image: cassandra:latest
networks:
- reactive-network
volumes:
- cassandra_data:/var/lib/cassandra
# - ${PWD}/data/cassandra/data:/var/lib/cassandra
@xmlking
xmlking / install-sdkman.sh
Created March 21, 2017 00:11
clean install sdkman
#!/usr/bin/env bash
set -e
rm -rf ~/.gvm
rm -rf ~/.sdkman
curl -s get.sdkman.io | bash
echo sdkman_auto_answer=true > ~/.sdkman/etc/config
@xmlking
xmlking / index.html
Last active November 6, 2020 12:28
web-bluetooth demo with Polar H7 Heart Rate Monitor *** need Chrome v54 ***
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles.css">
<script src="script.js"></script>
</head>
<body>
<div class='hr-table'>
<div class='hr-row'>
<div class='hr-cell'>
<div class='hr-header'>Heart Rate:</div>
@xmlking
xmlking / TodosService.ts
Created May 28, 2016 16:22
Observable - Observer
import { Http } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import 'rxjs/add/operator/share';
import { Todo } from 'app/interfaces';
export class TodosService {
todos$: Observable<Todo[]>;
private _todosObserver: Observer<Todo[]>;
private _dataStore: {
@xmlking
xmlking / nifi-twitter.groovy
Last active June 1, 2016 21:48
Example script for Apache NiFi's ExecuteScript Processor using @grab Ref: http://funnifi.blogspot.com/2016/05/using-groovy-grab-with-executescript.html . Set dynamic properties for ExecuteScript with your twitter consumerKey, consumerSecret accessToken and secretToken
@Grab('org.codehaus.groovy.modules.http-builder:http-builder:0.7')
@Grab('oauth.signpost:signpost-core:1.2.1.2')
@Grab('oauth.signpost:signpost-commonshttp4:1.2.1.2')
import groovy.json.JsonOutput
import groovyx.net.http.RESTClient
import static groovyx.net.http.ContentType.*
import org.apache.http.params.HttpConnectionParams
import com.crossbusiness.nifi.processors.NiFiUtils as util