Skip to content

Instantly share code, notes, and snippets.

View kathisai's full-sized avatar
💻
Focusing on open source

Kathi sai prathap reddy kathisai

💻
Focusing on open source
View GitHub Profile
@kathisai
kathisai / Kotlin_Type_safe_builder.kt
Created August 27, 2021 18:36
simplified Kotlin type safe builder example
// Lets say I wanted to build a Car
// -> wheel
// -> engine
// -> body
fun main() {
//This is possible with type Safe builders and DSL
car {
// this: Car
wheel {
// thisL Wheel
@kathisai
kathisai / The Technical Interview Cheat Sheet.md
Created March 1, 2021 09:46 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

version: 2.1
orbs:
android: circleci/android@0.2.1
slack: circleci/slack@3.4.2
jobs:
build-distribute:
working_directory: ~/code
executor: android/android
environment:
JVM_OPTS: -Xmx2048m
@kathisai
kathisai / jenkinsfile
Created January 10, 2020 09:09
JenkinsFile for docker image build and Kubernetes
pipeline {
agent {
label 'reactapp-node' // This is my slave node machine I want to run this pipeline on my slave agent
}
stages {
/* see # https://gist.github.com/nicferrier/2277987 for automating clone + pull */
stage('Cloneing deployments') {
steps {
echo 'Cloneing && pulling....'
@kathisai
kathisai / kube_service_deploy.yaml
Created January 10, 2020 09:02
Kuberneters Service and Deployment for React application on 8080 port
# React Service
apiVersion: v1
kind: Service
metadata:
name: test-react-service
spec:
externalIPs:
- **.**.***.**
@kathisai
kathisai / default.conf
Created January 10, 2020 08:55
nginx config for React applications
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /index.html; #This is needed for React applications to support routers in nginx
}
@kathisai
kathisai / reactApp_dockerfile
Created January 10, 2020 08:53
React application dockerfile
FROM ubuntu AS build
WORKDIR /src
# Clone the latest source
RUN git -c http.sslVerify=false clone https://github.com***/**/reactproject.git
WORKDIR /src/app
# Checkout the master branch -- no action needed as its default branch
RUN npm install
public class MyService extends Service {
// Binder given to clients
private final IBinder binder = new LocalBinder();
// Random number generator
private final Random mGenerator = new Random();
/**
* Class used for the client Binder. Because we know this service always
* runs in the same process as its clients, we don't need to deal with IPC.
*/
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
public class MainActivity extends AppCompatActivity {
class ExampleService : IntentService("ExampleService") {
override fun onHandleIntent(intent: Intent?) {
// Normally we would do some work here, like download a file.
// For our sample, we just sleep for 5 seconds.
try {
Thread.sleep(5000)
} catch (e: InterruptedException) {
// Restore interrupt status.