Skip to content

Instantly share code, notes, and snippets.

View pj8912's full-sized avatar
💭
...

John Pinto pj8912

💭
...
View GitHub Profile
@pj8912
pj8912 / fileinfo.php
Created March 16, 2021 05:29
php get file information
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>File Info</title>
</head>
to open a file
<code> vim FILE_NAME </code>
start writing:
press<code>i</code>
after opening the file the commands appear at the bottom of the terminal
do not write commands inside the file.
press ESC to exit the writing mode, press i again to write current file
why main method is static?
Java main() method is always static,
so that compiler can call it without the
creation of an object or before the creation of an object of the class. ... So, the compiler needs to call the main() method. If the main() is allowed to be non-static, then while calling the main() method JVM has to instantiate its clas
Used alongside a WHERE clause as a shorthand for multiple OR conditions.
So instead of:
SELECT * FROM users
WHERE country = 'USA' OR country = 'United Kingdom' OR
country = 'Russia' OR country = 'Australia';
You can use:
SELECT * FROM users
Postgres is an object-relational database, while MySQL is a purely relational database. Postgres also adheres more closely to SQL .
# connecting with phpmyadmin(apache,mysql) mysql database using python
# Its working..
# pip install pymysql
import pymysql
connection = pymysql.connect(
host = "localhost",
user = "root",
passwd = "",
database = "ws_test"
)
@pj8912
pj8912 / windowClearCache.txt
Created June 14, 2021 04:29
Clear cahce in windows 10
go to C:\Windows\SoftwareDistribution\Download>
Select all the cache files and delete.
The CAP theorem[Apache Cassandra]
- [CAP] : Consistent, Available, Partition Tolerant
- A Distributed Database like Cassandra cannot be Consistent, cannot be Available,cannot be PartitionTolerant at the same time.
- They Do not overlap eachother.
- Consistent : data being available at time needed.
- Availability : every non-failing node returns a response to any read/write request in a reasonable period of time.
- Partition Tolerant : The system will continue to function even during a network partition or a failure.
So based on CAP theorem we two of these attributes at the same time.
@pj8912
pj8912 / web3-account.
Created November 19, 2021 06:50
Creating account in web3.js
Creating account in web3.js
create in cli
" web3.eth.accounts.create() "
create zip folder in terminal
zip -r [name of the zip folder you want] file, folder
eg. zip -r test text.1, music
it creates a folder named 'test.zip' and upload the file 'text.1'
and folder 'music' into test.zip
test.zip/
text.1
music/