Skip to content

Instantly share code, notes, and snippets.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © janaka
//@version=5
strategy("My script", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
shortSMA = ta.sma(close, 11)
longSMA = ta.sma(close, 30)
trendSMA = ta.sma(close, 200)
rsi = ta.rsi(close, 14)
atr = ta.atr(14)
@pathnirvana
pathnirvana / .config
Created September 8, 2021 06:57
stm32f401xc zephyr uf2 config
CONFIG_GPIO=y
# CONFIG_SPI is not set
# CONFIG_I2C is not set
# CONFIG_KSCAN is not set
# CONFIG_WIFI is not set
# CONFIG_MODEM is not set
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_SOC="stm32f401xc"
CONFIG_SOC_SERIES="stm32f4"
CONFIG_NUM_IRQS=85
@pathnirvana
pathnirvana / AsyncJava.js
Last active January 31, 2024 18:15
Async Await call to JavascriptInterface Android Java WebView
// Allows to call a Android java function asynchronously
// spawn long running computations/io on the Java/Android without blocking the JS/Website running inside the WebView
// Eg. const result = await callAndroidAsync('javaFunction', { param1: 'value1', param2: 'value2' })
// Please give a star if you find this useful
export async function callAndroidAsync(javaFuncName, params) {
const rand = 'asyncJava_' + Math.floor(Math.random() * 1000000)
window[rand] = {}
// func called from android