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 / 0_reuse_code.js
Created April 29, 2016 14:49
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#include<iostream>
#include<conio.h>
using namespace std;
void tower(int, char[], char[], char[]);
void main()
{
int N;
<div class="row" style="background-color:#006699;"><br>
<div class="col-sm-6"></div>
<div class="col-sm-3">
<div class="widget">
<form class="form-search">
<input class="form-control" type="text" placeholder="Search..">
</form>
</div>
</div>
<div class="col-sm-1" ><ul class="social-network">
@shrawanx
shrawanx / mongo_u.txt
Created March 18, 2017 13:37
Mongodb basic usuage
service mongod start
service mongod stop
service mongod restart
show dbs --->will show all database
use [database name]---->will use the db
db.dropDatabase() ---> will drop database of selected database or else test db is deleted
@shrawanx
shrawanx / views.py
Created April 4, 2018 09:10
Dynamically rendering custom templates tags from view to template in django
def home(request):
from django.template import Context
from django.template import Template
from django.template.loader import render_to_string
x = '{% load custom_tags %} {% user_count %}'
prepare = {'tags':x}
x = render_to_string('home.html',context=prepare,request=request)
template = Template(x)
context = Context({})
y = template.render(context)
@shrawanx
shrawanx / demo.sql
Created May 18, 2018 02:45
SQL Trigger
create table student(
rollno number(5),
nam varchar(50));
create table audittrail(
rollldata number(5),
namedata varchar(50),
operationname varchar(60),
@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
@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 / 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 / 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'