Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Rajat Varyani RajatVaryani

🎯
Focusing
View GitHub Profile
View Discounter.java
import java.util.Calendar;
//Discounter tells whether discount is applicable or not.
public class Discounter {
public boolean isDiscountApplicable() {
Calendar calendar = Calendar.getInstance();
return calendar.get(Calendar.DAY_OF_WEEK) == 1
&& calendar.get(Calendar.MONTH) != 11;
}
}
View Discounter.java
import java.util.Calendar;
//Discounter tells whether discount is applicable or not.
public class Discounter {
public boolean isDiscountApplicable() {
Calendar calendar = Calendar.getInstance();
return calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY
&& calendar.get(Calendar.MONTH) != Calendar.DECEMBER;
}
}
View keybase.md

Keybase proof

I hereby claim:

  • I am rajatvaryani on github.
  • I am rajatvaryani (https://keybase.io/rajatvaryani) on keybase.
  • I have a public key ASD1nopYrMjmvjtXNHktKMwOgTznwlBC81M1UOrdNC5BYgo

To claim this, I am signing this object:

@RajatVaryani
RajatVaryani / plugin.go
Last active Dec 3, 2019
Initial version of Proposed changes
View plugin.go
// ------------------ Proposed changes in helpers ----------------------------
var rootCommand *cobra.Command
var lock sync.Mutex
func (p *HelpersImpl) RegisterCobraSlashCommand(c *cobra.Command, mcmd *model.Command) error {
rootCommand = c
if err := p.API.RegisterCommand(mcmd); err != nil {
return err
View execute_command.go
// Change in the Plugin.
func (p *Plugin) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError) {
return p.Helpers.ExecuteCommand(c, args)
}
View keybase.md

Keybase proof

I hereby claim:

  • I am RajatVaryani on github.
  • I am rajatv (https://keybase.io/rajatv) on keybase.
  • I have a public key whose fingerprint is A6D7 234A E344 520C CD24 5832 8F2C 0E00 30D7 9728

To claim this, I am signing this object:

View Badecode.java
public String statement() {
double totalAmount = 0;
int frequentRenterPoints = 0;
Enumeration rentals = _rentals.elements();
String result = "Rental Record for " + getName() + "\n";
while (rentals.hasMoreElements()) {
double thisAmount = 0;
Rental each = (Rental) rentals.nextElement();
//determine amounts for each line
switch (each.getMovie().getPriceCode()) {