Skip to content

Instantly share code, notes, and snippets.

Sivabudh Umpudh sivabudh

Block or report user

Report or block sivabudh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sivabudh
sivabudh / sample.json
Created May 6, 2018
/api/categories/id/shallow-get/
View sample.json
{
"id": 9713,
"sequence": 1,
"has_children": true,
"name": "LIXIL",
"header_image": null,
"content_image": "http://0.0.0.0:8000/media/foto/content_image/1_LIXIL_content_megqk8u.jpg",
"popup_image": null,
"product_view_type": 1,
"product_selection_type": 1,
View console.sh
python manage.py test
Hey, I'm Local!
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/pool.py", line 1122, in _do_get
return self._pool.get(wait, self._timeout)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/queue.py", line 145, in get
raise Empty
sqlalchemy.util.queue.Empty
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
@sivabudh
sivabudh / my_jobs_for_tl.txt
Created Aug 6, 2017
Displaying My Jobs for TL role
View my_jobs_for_tl.txt
Logic for displaying "My Jobs" for TL:
From PMJobModel table, any jobs that:
1) PMJobModel.userTL == TL's user ID
AND
2) PMJobModel.JobStatus == "submitted" OR "reviewing" OR "FO reject"
@sivabudh
sivabudh / bad_query.sql
Last active Jul 15, 2017
Bad SQL Query taking almost 30 seconds to respond
View bad_query.sql
SELECT "nodes_node"."id", "nodes_node"."alive", "nodes_node"."name", "nodes_node"."node_type", "nodes_node"."province", "nodes_node"."postal_code", "nodes_node"."attributes" FROM "nodes_node" WHERE ("nodes_node"."alive" = true AND "nodes_node"."id" IN (7, 3258, 3260, 8228, 8229, 8230, 8231, 8232, 8233, 8234, 8235, 8236, 8237, 8238, 8239, 8240, 8241, 8242, 8243, 8244, 8245, 8246, 8247, 8248, 8249, 8250, 11409, 8252, 8253, 8254, 8255, 8256, 8257, 8258, 8259, 8260, 11410, 8262, 8263, 8264, 8265, 8266, 8267, 8268, 8269, 11413, 8271, 11412, 8273, 8275, 8276, 8277, 11414, 8280, 8281, 8282, 8283, 8284, 8285, 8286, 8287, 3275, 8289, 8290, 8291, 8292, 8293, 8294, 8295, 8296, 8297, 8298, 8299, 11418, 8301, 8302, 8303, 8304, 8305, 8306, 8307, 8308, 8309, 8310, 8311, 8312, 8313, 8314, 11421, 8316, 8317, 8318, 8319, 8320, 8321, 8322, 8323, 8324, 8325, 8326, 8327, 8328, 8329, 8330, 8331, 8332, 8333, 8334, 8335, 8336, 8337, 8338, 8339, 11425, 8341, 9799, 8342, 8344, 8345, 8346, 8347, 8348, 8349, 8350, 8351, 8352, 8353, 8354
View grit_orders.js
// [POST] to URL: https://eneos-pos-prod.sbrandpos.com/api/orders/
{
"car_data_id" : 10424,
"customer_id" : 7492,
"staff_comment" : "Image Object",
"shop" : 62,
"staff" : 838,
"order_items" : [
{
View error.sh
ERROR in [at-loader] ./yaoms/apps/nav-bar/nav-bar.component.ts:43:22
TS2686: '_' refers to a UMD global, but the current file is a module. Consider adding an import instead.
Child html-webpack-plugin for "index.html":
[0] ./~/lodash/lodash.js 540 kB {0} [built]
[] -> factory:90ms building:4052ms = 4142ms
[1] ./~/html-webpack-plugin/lib/loader.js!./yaoms/index.html 2.72 kB {0} [built]
factory:102ms building:29ms = 131ms
[2] (webpack)/buildin/global.js 509 bytes {0} [built]
[] -> factory:161ms building:1082ms = 1243ms
[3] (webpack)/buildin/module.js 517 bytes {0} [built]
@sivabudh
sivabudh / nginx.conf
Last active Apr 4, 2017
Microservices with NGINX
View nginx.conf
#
# NGINX config for microservices
# Tested with nginx/1.10.3
#
worker_processes 5;
events {
worker_connections 4096;
}
@sivabudh
sivabudh / portal_app_changes.sh
Created Mar 22, 2017
Commands being run on the application
View portal_app_changes.sh
372 21/03/17 11:35:38 clear
373 21/03/17 11:35:42 history
374 21/03/17 11:35:54 clear
375 21/03/17 11:35:59 cat /etc/rc.local
376 21/03/17 11:36:02 clear
377 21/03/17 11:36:05 vi /etc/network/interfaces
378 21/03/17 11:36:47 history |grep &&
379 21/03/17 11:36:53 history |grep "&&"
380 21/03/17 11:36:57 ip a
381 21/03/17 11:37:00 clear
@sivabudh
sivabudh / failed_tests.sh
Created Mar 13, 2017
We have failing tests.
View failed_tests.sh
python manage.py test
.............FF.......
======================================================================
FAIL: test_api_should_have_tire_after_service_is_added (eneos.apps.recommendations.tests.RecommendationAPITest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/buddy/eneos-pos-web/eneos/apps/recommendations/tests.py", line 32, in test_api_should_have_tire_after_service_is_added
response = self.client.get(reverse_lazy('api:recommendation-list'))
File "/usr/local/lib/python3.6/site-packages/rest_framework/test.py", line 282, in get
response = super(APIClient, self).get(path, data=data, **extra)
@sivabudh
sivabudh / min_and_max.py
Created Mar 4, 2017
How to query for Min and Max at the same time
View min_and_max.py
>>> from django.db.models import Max, Min
>>> Store.objects.annotate(min_price=Min('books__price'), max_price=Max('books__price'))
You can’t perform that action at this time.