Skip to content

Instantly share code, notes, and snippets.

@hesido
hesido / evaluatepath.py
Created November 21, 2023 07:49
Blender Python Function To Evaluate User Input Property Paths without Eval
def evaluate_path(path, alternative_root = None):
#alternative_root can be used to define a default parent root object if user is not expected to enter full path
#Note: full paths start with "bpy."
if(path is None or path == ""):
return (None, None, None)
#Regular expression pattern to match segments of the path
pattern = r'(.+?)\.|(?:\["(.+?)"\])|([^"\[\]]+)'
segments = re.findall(pattern, path)
parent_obj = None
enumerate_from = 0
@hesido
hesido / miningpoolbalance.js
Last active March 6, 2022 21:17
Google Spreadsheet Script To Get Mining Pool Balances - for Flexpool and Ethermine
/**
* Returns Balance From Flexpool api v2
*
* @param {string} account (required)
* @return {number} Amount in balance
* @customfunction
**/
function FlexPoolBalance(account) {
let Result = 0;
coinType = "eth";
@hesido
hesido / RunAtStartup.cmd
Last active January 20, 2021 18:26
Powershell script to run batch based on display adapter count
REM Set your powershell script filepath here
set scriptpath="C:\Tools\Devcon\RunBatchBasedOnDisplayAdapterCount.ps1"
timeout 15
REM Run PowerShell in CMD file
REM source:https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-startup-tasks-common
REM Attempt to set the execution policy by using PowerShell version 2.0 syntax.
PowerShell -Version 2.0 -ExecutionPolicy Unrestricted %scriptpath% >> "%TEMP%\StartupLog.txt" 2>&1
@hesido
hesido / coingecko.js
Last active November 13, 2023 23:15
Coingecko Add On for Google Spreadsheets
/**
* Returns Market Value From Coingecko api
* Function accepts ranges as well, please use it to reduce server lookups, so it fetches data only once.
* Update: 17.02.2020
*
* @param {string} symbol pair (required)
* @param {string} Default Value Missing Data (optional)
* @return {number} ticker price
* @customfunction
**/
@hesido
hesido / tradeogreticker.js
Last active February 14, 2020 21:12
TradeOgre ticker script for Google Spreadsheets
/**
* Returns Ticker Price From TradeOgre exchange
* Function accepts ranges as well, please use it to reduce server lookups, so it fetches data only once.
*
* @param {string} ticker name
* @param {string} ticker type
* @return {number} ticker price
* @customfunction
**/
function ReturnTickerPrice(TickerName, TickerType) {