Skip to content

Instantly share code, notes, and snippets.

View shrawanx's full-sized avatar
🏠
Working from home

Shrawan P. shrawanx

🏠
Working from home
View GitHub Profile
@shrawanx
shrawanx / cg.py
Last active October 1, 2023 18:09
Python Program to implement Point, Line Segment, Ray and Line
DEBUG = True
def input_and_exit_keys_handler(
msg="Enter your choice [or press c to exit]:"
) -> int:
if not msg.endswith(" "):
msg += " "
while True:
choice = input(msg)
@shrawanx
shrawanx / page_replacements_algo.py
Created July 12, 2023 20:04
Analysis of various page replacement algo
import random
DEBUG_MODE = 0
def _debug_printer(*args):
if DEBUG_MODE:
for s in args:
print(s, end="")
print()
@shrawanx
shrawanx / run.json
Created April 2, 2023 11:41
run.json example for running Django inside Jetbrains fleet IDE (.fleet/run.json)
{
"configurations": [
{
"name": "Run Django",
"type": "python",
"arguments": ["manage.py", "runserver", "0.0.0.0:8000"],
"environment": {
"PYTHONUNBUFFERED": "1",
}
}
@shrawanx
shrawanx / build.sh
Created July 22, 2022 19:59
push build.zip to server
cd build && zip -r ../build.zip . *;cd -
scp build.zip server:/home/ubuntu/
ssh server /bin/bash << EOF
unzip /home/ubuntu/build.zip -d /home/ubuntu/frontend/
A
EOF

Keybase proof

I hereby claim:

  • I am shrawanx on github.
  • I am shrawanx (https://keybase.io/shrawanx) on keybase.
  • I have a public key ASCqs0xGRfvZzh-7odD3jKo7wbhX6gZSp0R1cV1pAHUWhwo

To claim this, I am signing this object:

@shrawanx
shrawanx / circus.ini
Last active May 13, 2019 11:49
Deploy Config
[watcher:webapp]
cmd = chaussette app.wsgi:application --fd $(circus.sockets.webapp)
uid=ubuntu
endpoint_owner=ubuntu
numprocesses = 3
use_sockets = True
copy_env = True
copy_path = True
virtualenv = /home/ubuntu/env/
stdout_stream.class = FileStream
@shrawanx
shrawanx / django-installation.md
Created January 3, 2019 08:06
Django Installation Guide

On Database Server

Install Postgres

wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | 
sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ 
`lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
@shrawanx
shrawanx / defense.txt
Created July 20, 2018 01:44
test for the mid defense
Hhello world , this is for the defense of the compiler project code for kids .
@shrawanx
shrawanx / query.sql
Created June 15, 2018 03:02
rollup and cube operations
--ROLLUP AND CUBE OPERATIONS
select department_id , sum(salary)
from employees group by department_id
order by department_id;
select department_id ,job_id, sum(salary)
from employees group by department_id,job_id
order by department_id;
@shrawanx
shrawanx / query.sql
Created June 15, 2018 02:44
UDT inheritance ,objects . Oracle
create or replace Type Personobj as object(
fisrt_name varchar(20),
last_name varchar(20),
date_of_birth Date,
member function getAge return number
);
create or replace type body Personobj as
member function getAge return number is
begin