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
<idea-plugin version="2">
<id>com.your.company.unique.plugin.id</id>
<name>Plugin display name here</name>
<version>1.0</version>
<vendor email="support@yourcompany.com" url="http://www.yourcompany.com">YourCompany</vendor>
<description><![CDATA[
sample code for dev fest.<br>
<em>most HTML tags may be used</em>
]]></description>
public class MouseClickAction extends AnAction {
@Override
public void actionPerformed(AnActionEvent e) {
PsiClass psiClass=getPsiClassFromContext(e);
new ToStringGenerator(psiClass).execute();
}
public class ToStringGenerator extends WriteCommandAction.Simple {
private PsiClass aClass;
public ToStringGenerator(PsiClass aClass) {
super(aClass.getProject(), aClass.getContainingFile());
this.aClass = aClass;
}
@nvinayshetty
nvinayshetty / Snappy db progaurd rules
Created February 8, 2017 07:41
Snappy db progaurd rules
-dontwarn sun.reflect.**
-dontwarn java.beans.**
-keep,allowshrinking class com.esotericsoftware.** {
<fields>;
<methods>;
}
-keep,allowshrinking class java.beans.** { *; }
-keep,allowshrinking class sun.reflect.** { *; }
-keep,allowshrinking class com.esotericsoftware.kryo.** { *; }
-keep,allowshrinking class com.esotericsoftware.kryo.io.** { *; }
@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);
@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 / 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 / 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 / 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;
message SampleMessage {
oneof test_oneof {
string name = 4;
SubMessage sub_message = 9;
}
}