Skip to content

Instantly share code, notes, and snippets.

View dashaluna's full-sized avatar

Dasha Luna dashaluna

View GitHub Profile
function __construct( ) {
add_action( 'init', array( $this, 'register_shortcode_ui' ) );
}
function register_shortcode_ui() {
apply_filters( 'hm_toc_register_shortcode_ui', false );
// Do I need to include the actual code/file here that registers things
@dashaluna
dashaluna / .html
Created February 2, 2017 14:13
Ooyala iframe markup with ads for FB IA
FB IA markup:
<p>Official ooyala plugin shortcode:</p>
<figure class="op-interactive">
<iframe
src="https://thesuncouk-develop.go-vip.co/ooyala-iframe/33447?code=t4OWo4NTE6Ye7cqQPGJ7ZPXNTA0ULOrj&amp;player_id=YmRmN2I0ZDMwNDI5NTFlZGI4NDM1OWM4&amp;width=1920&amp;height=1080&amp;caption=test_ooyala_upload_02.mp4&amp;auto=true"
class="no-margin" width="480" height="320"></iframe>
</figure>
<p>Our custom generated iframe &amp; player:</p>
@dashaluna
dashaluna / dailyValuation.gs
Created August 5, 2023 12:48
GSheet Script for daily valuation
function plotDailyValuation() {
//read the counter (#) in cell A1 of History, number in cell is the row of column to input data
var counter = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("History").getRange("D2");
// record DATE in cell A#
var date = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("History").getRange("A"+counter.getValue());
date.setValue(new Date(new Date().getFullYear(),new Date().getMonth(), new Date().getDate()));
//read portfolio value in "Portfolio Sheet"
var portfolioValue = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Portfolio").getRange("H18");
@dashaluna
dashaluna / dailyPL.gs
Created August 5, 2023 12:48
GSheet script for plotting daily P/L
function plotDailyPL() {
//read the counter (#) in cell A1 of History, number in cell is the row of column to input data
var counter = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("History").getRange("E2");
// record DATE in cell A#
var date = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("History").getRange("D"+counter.getValue());
date.setValue(new Date(new Date().getFullYear(),new Date().getMonth(), new Date().getDate()));
//read portfolio value in "Portfolio Sheet"
//***GLOBALS***//
var ss = SpreadsheetApp.getActive();
var portfolioSheet = ss.getSheetByName("master"); //replace master with name of the tab that has your portfolio data
var columnToCheck = portfolioSheet.getRange("A:A").getValues();
// Get the last row based on the data range of a single column.
var tickerCount = getLastRowSpecial(columnToCheck);
/************************************************************************
*
* Gets the last row number based on a selected column range values
//Get transactions from customer transaction history and sort them by date oldest to newest
var lastTransactionRow = SpreadsheetApp.getActive().getRangeByName('lastTransactionRow').getValue();
var transactions = SpreadsheetApp.getActive().getSheetByName("History").getRange("B3:J" + (lastTransactionRow - 1)).getValues();
transactions = transactions.sort(compareNthElements(4, basicComparator));
//specify which column contains the account name (arrays are 0 based)
var accountCol = 2;
//tickers may be duplicated across accounts; each key in a Map object must be unique; therefore each account needs it's own map
var account1 = new Map();
var account2 = new Map();
var account3 = new Map();