Skip to content

Instantly share code, notes, and snippets.

View shekarsiri's full-sized avatar
👋

Shekar Siri shekarsiri

👋
View GitHub Profile
@shekarsiri
shekarsiri / MultiTenantFlask.py
Created September 8, 2019 21:33 — forked from TonyFrancis/MultiTenantFlask.py
Creating multi Tenant system with multiple Database. Switching between databases based on subdomain related to tenant
from functools import wraps
from flask import Flask, g, session, request, abort, jsonify
from flask_migrate import MigrateCommand, Migrate
from flask_script import Manager
from flask_sqlalchemy import SQLAlchemy
flask_app = Flask(__name__, static_folder='./static')
db = SQLAlchemy()
migrate = Migrate()
@shekarsiri
shekarsiri / download.dart
Created July 27, 2018 13:58 — forked from slightfoot/download.dart
Download file in Dart/Flutter
static var httpClient = new HttpClient();
Future<File> _downloadFile(String url, String filename) async {
var request = await httpClient.getUrl(Uri.parse(url));
var response = await request.close();
var bytes = await consolidateHttpClientResponseBytes(response);
String dir = (await getApplicationDocumentsDirectory()).path;
File file = new File('$dir/$filename');
await file.writeAsBytes(bytes);
return file;
}

LEMP in Ubuntu 16.04 Server - AWS EC2/RDS

  1. Pre-usage:
sudo apt-get update && sudo apt-get upgrade -y
  1. Add ubuntu or the user used to sudo group:
@shekarsiri
shekarsiri / jiraRefreshTickets.js
Created November 15, 2017 08:28 — forked from rtrcolin/jiraRefreshTickets.js
Super simple Google Docs integration with Jira Issues/Tickets
// URL for Jira's REST API for issues
var getIssueURL = "https://[Your Jira host]/rest/api/2/issue/";
// Personally I prefer the script to handle request failures, hence muteHTTPExceptions = true
var fetchArgs = {
contentType: "application/json",
headers: {"Authorization":"Basic [Your BASE64 Encoded user:pass]"},
muteHttpExceptions : true
};
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
@shekarsiri
shekarsiri / gist:44b2dcbcdd687a6ac8151735341c6494
Created August 22, 2017 08:02 — forked from reviewnta/gist:a27b189d287f694e6971f94621b2cc8f
Amibroker AFL Code : Demand & Supply Zone Trading
//AUTO : DEMAND AND SUPPLY ZONE
//BY : www.niftytradingacademy.net
//Date : 29th June 2017
_SECTION_BEGIN("Demand");
SetChartOptions(0,chartShowArrows|chartShowDates);
bk=ParamColor( "Bk col",ColorRGB(85,90,60));
SetChartBkColor(bk);
amount = Param("Sensitivity", 0.5, 0.1, 2, 0.1 );
//AUTO : MACD Amibroker AFL
//BY : www.niftytradingacademy.net
//Date : 05th July 2017
_SECTION_BEGIN("MACD SIGNAL");
SetChartBkColor(ParamColor("Panel color ",colorBlack));
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorRed ), ParamStyle("MACD style") );
//AUTO : RSI : Over Bought & Over Sold
//BY : www.niftytradingacademy.net
//Date : 05th July 2017
_SECTION_BEGIN("RSI");
SetChartOptions(0,0,ChartGrid30|ChartGrid70,0,100);
periods = Param( "Periods", 14, 1, 200, 1 );
z = RSI( periods);
RSILineColor = ParamColor("RSI Line Color",ColorRGB(127,0,83));
RSIOverboughtColor = ParamColor("RSI Overbought Color",ColorRGB(127,0,83));
@shekarsiri
shekarsiri / Readme.md
Created August 19, 2017 20:11 — forked from surjithctly/Readme.md
NSE Open Hour Breakout JS Bookmarklet

Installation

javascript:!function(){function d(){(window.myBookmarklet=function(){console.log("Open Breakout Code Started \n Created by Surjith S M \nhttp://surjithctly.in/"),console.log("scanning"),$("#dataTable tr").each(function(){$("td",this).css("background",""),$("td a",this).css("color","");var a=$("td:nth-child(4)",this).text().replace(/,/g,""),b=$("td:nth-child(5)",this).text().replace(/,/g,""),c=$("td:nth-child(6)",this).text().replace(/,/g,""),d=$("td:nth-child(1)",this).text();a==b&&($("td:nth-child(5), td:nth-child(1)",this).css({color:"white",background:"Red"}),$("td:nth-child(1) a",this).css({color:"white"}),console.log("Go Short Found: "+d)),a==c&&($("td:nth-child(6), td:nth-child(1)",this).css("background","Lime"),console.log("Go Long Found: "+d))}),console.log("finished scanning \nThank you!")})()}var a="1.3.2";if(void 0===window.jQuery||window.jQuery.fn.jquery<a){var b=!1,c=document.createElement("script");c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+a+"/jquery.mi