Skip to content

Instantly share code, notes, and snippets.

View nvinayshetty's full-sized avatar
💭
Finally building an app that sparks joy!

Vinaya Prasad N nvinayshetty

💭
Finally building an app that sparks joy!
  • Singapore
View GitHub Profile
syntax = "proto3";
message Person{
//string name =1; <-- reserve both tag and name to deprecate a field
reserved 1;
reserved "name";
string first_name = 2;
string last_name = 3;
}
syntax = "proto3";
import "google/protobuf/duration.proto";
message MyMessage {
google.protobuf.Duration duration = 1;
}
syntax = "proto3";
import "google/protobuf/timestamp.proto";
message MyMessage {
google.protobuf.Timestamp time_stamp = 1;
}
syntax = "proto3";
message SimpleMap{
map<string, Project> projects = 3;
}
message SampleMessage {
oneof test_oneof {
string name = 4;
SubMessage sub_message = 9;
}
}
@nvinayshetty
nvinayshetty / simple_proto.proto
Created April 4, 2021 05:21
A simple proto file
syntax = "proto3";
message Person{
string first_name = 1;
string last_name = 2;
int32 age = 3;
float weight = 4;
repeated string addresses = 5;
enum Gender{
Unknown = 0;
@nvinayshetty
nvinayshetty / StateMachineDataStructure.kt
Created April 6, 2019 04:00
State Machine Data Structure
data class StateMachine(val states: Set<State>)
data class State(val name:String, val transitions:Set<Transition>)
data class Transition(val event:Event,val nextState:String)
data class Event(val eventName: String)
@nvinayshetty
nvinayshetty / dotCommand.bash
Last active April 6, 2019 03:58
Command to Generate diagram from dot file
dot -Tpng matterStateMachine.dot -o matterStateMachine.png
@nvinayshetty
nvinayshetty / matterStateMachine.dot
Created April 6, 2019 03:46
Example of a dot file
digraph matterStateMachine {
Solid -> Liquid [label="OnMelted"]
Liquid -> Solid [label="OnFrozen"]
Liquid -> Gas [label="OnVaporized"]
Gas -> Liquid [label="OnCondensed"]
}
@nvinayshetty
nvinayshetty / sample test
Created April 18, 2017 02:12
Test to check embeed
package com.nvinayshetty.refresher;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);