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!
\
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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....' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # React Service | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: test-react-service | |
| spec: | |
| externalIPs: | |
| - **.**.***.** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
NewerOlder