Skip to content

Instantly share code, notes, and snippets.

Avatar

Kalyan TM kalyantm

  • Bangalore, India
View GitHub Profile
@kalyantm
kalyantm / doctype-db.sql
Last active Sep 27, 2020
Doctype DB task
View doctype-db.sql
/*
2) Write the DDL for creating the tables for a MariaDB database with users, tweets and followers.
A user has a username, password, email, first name and last name.
A tweet has text, a publication date and is posted by a user.
A user can be followed by other users.
*/
CREATE TABLE users (
@kalyantm
kalyantm / solution.go
Last active Sep 14, 2020
DocType - Basics of GoLang
View solution.go
// 1. Write a struct in Go for a Person object that has a numeric Age attribute.
type Person struct {
Age int
}
// 1.1) Write two functions in Go with the following function signature: func ([]Person) bool
// The first function should return true if there is a person who is exactly twice as old as any other person in the list, otherwise the function returns false.
func doubleAgeExists(persons []Person) bool {
// Approach: Use a set (made from a GoLang Map DS) to store the age details
// On one parse, check if age/2 or age*2 exists for the given age.
@kalyantm
kalyantm / dropdown.jsx
Last active Sep 1, 2020
Dropdown component
View dropdown.jsx
/*
Prompt:
We have defined a basic dropdown via the Dropdown and DropdownItem components below, with example usage in the ExampleNav component.
The Dropdown and DropdownItem components have some problems, and also have room for improvements.
Please fix any obvious bugs you see with the dropdown, and explain your reasoning.
Please then describe some improvements you would make to the dropdown, and how you would implement them.
Consider the different contexts in which you might use this dropdown and what changes might be neccessary to make it more flexible.
Follow up question: if we wanted to sync this dropdown selection to the server with app.sync('PATCH', 'user', { dropdown_1_state: {true,false} }) where would this be included
View SketchSystems.spec
My Awesome Sketch
Add Phone Number
add_phone_number -> Resend Code Disabled
Resend Code Disabled
time_remaining? -> Resend Code Disabled
no_time_remaining? -> Verify Phone Number
max_resend_tries_reached? -> Verify Captcha Flow
verify_phone_number -> Verifying Code
check_phone_number -> Redirect Phone Number?
@kalyantm
kalyantm / SketchSystems.spec
Last active Mar 10, 2020
Add Phone Number Flow
View SketchSystems.spec
Add Phone Number Flow
Add Phone Number
add_phone_number -> Verify Phone Number
Verify Phone Number
resend_code -> Resend Code
verify_phone_number -> Verifying Code
check_phone_number -> Redirect Phone Number
Resend Code
@kalyantm
kalyantm / SketchSystems.spec
Last active Jan 6, 2020
PWA Login Screen SERP
View SketchSystems.spec
PWA Login Screen SERP
Main Page*
click login -> Login Modal
Login Modal
click continue with facebook -> Facebook OAuth Flow
focus input email textbox -> Active TextBox
focus input password -> Active TextBox
click login button -> Try Login Flow
You can’t perform that action at this time.