This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Sortable Table with Metro-UI</title> | |
<link rel="stylesheet" href="https://cdn.metroui.org.ua/v4/css/metro-all.min.css"> | |
</head> | |
<body> | |
<table class="table" data-role="table"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="https://cdn.metroui.org.ua/current/metro.css"> | |
</head> | |
<body> | |
<table class="table"> | |
<thead> | |
<tr> | |
<th>Header</th> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The list for where the dictionaries will be stored | |
result = list() | |
with open(file_path) as f: | |
# Do I need to cleanse the keys? | |
# Yes: but I will manually write the headers... | |
my_headers = ('Header 1', 'Header 2') | |
# Yes: but I just want to clean the current headers... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const summarize = (summaryContext) => { | |
log.debug({title: 'SUMMARY', details: summaryContext}); | |
if (summaryContext.inputSummary.error) { | |
log.error({title: 'INPUT ERROR', details: summaryContext.inputSummary.error}); | |
} | |
summaryContext.mapSummary.errors.iterator().each( | |
(key, error) => { | |
log.error({title: `MAP ERROR: ${key}`, details: error}); | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Payment amount formula as seen in Google Sheets/Excel PMT() | |
* @param {Number} rate - as a decimal not as a percentage, per period | |
* @param {Number} nper - total number of periods remaining, needs to be the same period as rate | |
* @param {Number} pval - present value | |
* @param {Number} [fv=0] - future value (default is 0) | |
* @param {Number} [type=0] - is payment in arrears, paid at the end of each period, (0) or in advance, paid at the start of each period (1) (default is 0 = arrears) | |
* @returns {Number} | |
*/ | |
function pmt(rate, nper, pval, fv = 0, type = 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Future Value formula as detailed in Google Sheets/Excel | |
* @param {Number} rate - as a decimal not as a percentage per period | |
* @param {Number} nper - total number of periods remaining, needs to be the same period as rate | |
* @param {Number} [pymt=0] - amount paid per period (optional is pval is not 0, otherwise default is 0) | |
* @param {Number} [pval=0] - present value of the annuity (optional if pymt is 0, otherwise default is 0) | |
* @param {Number} [type=0] - is payment in arrears, paid at the end of each period, (0) or in advance, paid at the start of each period (1) (default is 0 = arrears) | |
* @returns {Number} | |
*/ | |
function fv(rate, nper, pymt = 0, pval = 0, type = 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Present Value formula as detailed in Google Sheets/Excel | |
* @param {Number} rate - as a decimal not as a percentage per period | |
* @param {Number} nper - total number of periods remaining, needs to be the same period as rate | |
* @param {Number} pmt - amount paid per period | |
* @param {Number} [fv=0] - future value of the annuity (default 0) | |
* @param {Number} [type=0] - is payment in arrears, paid at the end of each period, (0) or in advance, paid at the start of each period (1) (default is 0 = arrears) | |
* @returns {Number} | |
*/ | |
function pv(rate, nper, pmt, fv = 0, type = 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import csv | |
json_raw = """ | |
{ | |
"employees": [{ | |
"name": "John Smith", | |
"salary": 120000 | |
},{ | |
"name": "Jane Doe", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
response = requests.get("https://example.com") | |
soup = BeautifulSoup(response.text, 'html.parser') | |
# define what common attributes the html tags contain | |
anchors = soup.find_all("a") | |
links = [a for a in anchors if a['href'].lower().endswith(".pdf")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @NApiVersion 2.x | |
* @NScriptType ClientScript | |
* @NModuleScope SameAccount | |
*/ | |
define(['N/record', 'N/currentRecord', 'N/url'], | |
/** | |
* @param {record} record | |
* @param {currentRecord} currentRecord | |
* @param {url} url |
NewerOlder