Skip to content

Instantly share code, notes, and snippets.

View 2tanayk's full-sized avatar
💭
Hustling 🏃‍♂️

Tanay Kamath 2tanayk

💭
Hustling 🏃‍♂️
View GitHub Profile
@2tanayk
2tanayk / Inheritance.sol
Created March 15, 2022 21:41
Solidity basics by freeCodeCamp.org
pragma solidity >=0.7.0 <0.9.0;
//inheritance in solidity
contract Parent{
string public name;
mapping(address=>uint256) public balances;
constructor(string memory _name) public {
name=_name;
}
public class MyActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
LinearLayout parent = findViewById(R.id.linearLayout);
//by doing this we lose all our theme customisation
@Database(entities = {SomeEntity.class}, version = 1)
public abstract class Database extends RoomDatabase {
private static Database instance;
public abstract SomeDao dao();
public static synchronized NoteDatabase getInstance(Context context) {
if (instance == null) {
instance = Room.databaseBuilder(context.getApplicationContext(), Database.class, "database").
fallbackToDestructiveMigration().
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.e("Activity context is", String.valueOf(this));
Button button = findViewById(R.id.btn);
@2tanayk
2tanayk / what_is_http.md
Last active November 8, 2020 18:26
Some notes on computer networking

What is HTTP(Hyper Text Transfer Protocol)? It is a protocol of the web which is responsible for communication between web servers and clients.Whenever you search for a website on the browser,submit a form on a website etc. you are using the HTTP (you are using one of its methods eg. GET,POST etc.) . It works via a request & response cycle. Requests & responses consists of header and a body.Each request can be thought of as a transaction. It is stateless ie all/any of the requests are independent of each other.It doesn't remember any of the previous requests while making a new one.(However,We can use cookies,local storage etc. to do save any information if needed.) HTTPS(Hyper Text Transfer Protocol Secure) is used to encrypt HTTP requests/responses for security purposes.The data is encrypted using SSL(Secure Sockets Layer) or TLS(Transport Layer Security) to protect sensitive information which is susceptible to MitM(man-in-the-middle) attacks.However its to be noted that HTTPS is just, much harder to crack b

@2tanayk
2tanayk / Some_compatibility_points.md
Last active February 2, 2021 08:24
How to get sponsorships? (A gist for TSEC Codecell committee)

Some points to check compatibility with a sponsor:

8 Compatibility Attributes:

  1. Relationship – Do you have an existing relationship or connection with the sponsor?
  2. Objectives – Do you fit with the marketing objectives of the sponsor?
  3. Audience – How closely do you share a common target audience?
  4. Competition – Does their competition use sponsorship in your area as a marketing tool?
  5. Attributes – How closely do the attributes of what you have to offer match or compliment that of the sponsor? E.g sophisticated, smart, loud, family orientated, original.
  6. Geography – Does the sponsor operate in the same geography as you and have marketing objectives targeting the same level? E.g. National, state, region, city, district, suburb.
  7. Comfort – How comfortable are they using sponsorship as a marketing tool? Do they have a strong sponsorship history?
@2tanayk
2tanayk / python_mysql.py
Created July 14, 2020 11:26 — forked from bradtraversy/python_mysql.py
Python & MySQL crash course for beginners
import mysql.connector
from mysql.connector import errorcode
config = {
'user': 'root',
'password': '',
'host': 'localhost',
'database': 'acme'
}