Skip to content

Instantly share code, notes, and snippets.

View vividvilla's full-sized avatar

Vivek R vividvilla

View GitHub Profile
@vividvilla
vividvilla / osxtweaks
Created January 8, 2020 10:45 — forked from webdevbrian/osxtweaks
Brian's List of OSX Tweaks for web developers
#OSX Tweaks:
===========
- Most need reboot to show changes
- Most of these tweaks are just for speed, but some are specific for development
- All of these are to be ran in terminal. The commands to be copy and pasted start after the less-than sign.
- I'm not responsible for any adverse effects to your computer, at all.
##Increase the speed of OS X dialogs boxes:
@vividvilla
vividvilla / ring-counter.v
Created January 23, 2013 14:05
Verilog Program for Ring Counter with Test bench and Output
/* Code written by Anand K
contact me at itsexzion@gmail.com */
module ring_count(q,clk,clr);
input clk,clr;
output [3:0]q;
reg [3:0]q;
always @(posedge clk)
if(clr==1)
q<=4′b1000;
@vividvilla
vividvilla / README.md
Created November 10, 2017 09:31
Kite connect Python ticker save to database example

Instructions

@vividvilla
vividvilla / kiteconnect_flask.py
Last active May 24, 2023 17:18
Kite Connect Python Flask Example
import json
from flask import Flask, request
from kiteconnect import KiteConnect
# Base settings
PORT = 5010
HOST = "127.0.0.1"
# Kite Connect App settings. Go to https://developers.kite.trade/apps/
# to create an app if you don't have one.
@vividvilla
vividvilla / test_streaming.py
Last active October 16, 2022 12:32
Kite Connect Python client websocket streaming example - https://github.com/rainmattertech/pykiteconnect
import logging
from kiteconnect import WebSocket
logging.basicConfig(filename='ticks.log', level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
# Initialise.
kws = WebSocket("api_key", "public_token", "user_id")
tokens = [5215745, 633601, 1195009, 779521, 758529, 1256193, 194561, 1837825, 952577, 1723649, 3930881, 4451329, 593665, 3431425, 2905857, 3771393, 3789569, 3463169, 381697, 54273, 415745, 2933761, 3580417, 49409, 3060993, 4464129, 3375873, 4574465, 636673, 3721473, 2796801]
print("Tokens length", len(tokens))
@vividvilla
vividvilla / gist:bdab68fd89a53ae9d8c1431d43060956
Created September 30, 2022 10:48
Element gruvbox custom 1
{
"name": "Gruvbox custom 1",
"is_dark": true,
"colors": {
"accent-color": "#bd93f9",
"primary-color": "#fe8019",
"warning-color": "#fb4934",
"sidebar-color": "#282828",
"roomlist-background-color": "#1d2021",
"roomlist-text-color": "#a89984",
@vividvilla
vividvilla / element-gruvbox-custom.json
Created September 30, 2022 10:44
element-gruvbox-custom
{
"name": "Gruvbox custom",
"is_dark": true,
"colors": {
"accent-color": "#bd93f9",
"primary-color": "#fe8019",
"warning-color": "#fb4934",
"sidebar-color": "#282828",
"roomlist-background-color": "#1d2021",
"roomlist-text-color": "#a89984",
@vividvilla
vividvilla / element-test.css
Last active September 30, 2022 10:38
element-test-theme
{
"name": "Gruvbox",
"is_dark": true,
"colors": {
"accent-color": "#bd93f9",
"primary-color": "#fe8019",
"warning-color": "#fb4934",
"sidebar-color": "#282828",
"roomlist-background-color": "#1d2021",
"roomlist-text-color": "#a89984",
@vividvilla
vividvilla / element-no-bs.json
Last active September 30, 2022 10:35
No bullshit theme for Element web
{
"name": "No bs theme",
"is_dark": false,
"colors": {
}
}
@vividvilla
vividvilla / mailer.py
Last active August 5, 2022 20:14
Mailer - Simple Python wrapper to send email via SMTP
from smtplib import SMTP # Use this for standard SMTP protocol (port 25, no encryption)
# from smtplib import SMTP_SSL as SMTP # This invokes the secure SMTP protocol (port 465, uses SSL)
from email.mime.text import MIMEText
class Email(object):
SMTP_CONFIG = dict(
server="your_smtp_server_hostname",
username="your_smtp_server_username",
password="your_smtp_server_password"