Skip to content

Instantly share code, notes, and snippets.

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

Aman Kumar aman0511

🏠
Working from home
View GitHub Profile
@aman0511
aman0511 / install-postgres-postgis-gdal.sh
Created September 12, 2018 02:53 — forked from mdiener21/install-postgres-postgis-gdal.sh
Setup Ubuntu 16.04 for GIS development postgresql 9.6, postgis 2.3, gdal 2.1.2, python 3.5, pgrouting
sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.6
sudo apt-get install postgresql-9.6-postgis-2.3
sudo apt-get install postgresql-9.6-pgrouting
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
1. What is the output of this C code?
#include <stdio.h>
int main()
{
int a = 10;
double b = 5.6;
int c;
c = a + b;
printf("%d", c);
}
I’ve been a professional software/web developer for 2.5 years. I have worked on small (20-30) and build the product for differnt organisations.
I’m glad I did because it turns out that I love it.
Time: 45 Min
Read the below passage carefully and answer the questions:
At a small company, parking spaces are reserved for the top executives: CEO, president, vice president, secretary, and treasurer with the spaces lined up in that order. The parking lot guard can tell at a glance if the cars are parked correctly by looking at the color of the cars. The cars are yellow, green, purple, red, and blue, and the executives names are Alice, Bert, Cheryl, David, and Enid.
* The car in the first space is red.
* A blue car is parked between the red car and the green car.
* The car in the last space is purple.
* The secretary drives a yellow car.
Account:
Register User:
--------------------------
Method: POST
End Point: /accounts/user/
data = {
"name": "",
"email": "",
"password": "",
1. Inventory:
POST: /inventory/
PATCH: /inventory/<id>
DELETE: /inventory/<id>
GET: /inventory/
{
"id" : "",
"name": "",
price :
quantity: ""
@aman0511
aman0511 / api.text
Last active September 12, 2016 11:12
Api Doc
----------------------------------
login:
1. http://localhost:8000/accounts/login/
{
"password": "",
"username": ""
@aman0511
aman0511 / Django Haystack Solr Setup
Created September 5, 2016 12:54 — forked from stvbdn/Django Haystack Solr Setup
Django + Haystack + Solr Installation/Setup
### Solr Install ###
Install pysolr and django-haystack and set up django-haystack. Setup for haystack is pretty straight forward:
https://django-haystack.readthedocs.org/en/v1.2.7/tutorial.html
Make sure you follow the haystack instructions for the correct version of haystack that you installed,
as some of the setting variables are different depending on the version.
# SSH into the server that you want to install Solr on
@aman0511
aman0511 / exceptions.py
Created July 11, 2016 10:12 — forked from jpadilla/exceptions.py
Custom exception handler for Django Rest Framework that adds the `status_code` to the response and renames the `detail` key to `error`.
from rest_framework.views import exception_handler
def custom_exception_handler(exc):
"""
Custom exception handler for Django Rest Framework that adds
the `status_code` to the response and renames the `detail` key to `error`.
"""
response = exception_handler(exc)
@aman0511
aman0511 / django_log_settings.py
Created July 8, 2016 06:40 — forked from st4lk/django_log_settings.py
Django logging settings
# Logging settings for django projects, works with django 1.5+
# If DEBUG=True, all logs (including django logs) will be
# written to console and to debug_file.
# If DEBUG=False, logs with level INFO or higher will be
# saved to production_file.
# Logging usage:
# import logging
# logger = logging.getLogger(__name__)
# logger.info("Log this message")