This file contains hidden or 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
| // Example of Json-RPC API for Simagis Live Server, learn more about Json-RPC at http://json-rpc.org/ | |
| // Json-RPC Library for JavaScript http://github.com/gimmi/jsonrpcjs/ | |
| // | |
| // 1. Create Json-RPC Object | |
| var rpc = new jsonrpc.JsonRpc('http://host.simagis.com/live-json-rpc/api'); | |
| var workspace = 'vk'; | |
| var projectId = '053e8d4d-ebfc-488a-bc2c-c826e41fe43d'; | |
| projectId = prompt('Enter Project ID', projectId ); |
This file contains hidden or 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
| x<-1:10 |
This file contains hidden or 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
| # convert NA to Zero | |
| log_pay_dt[,lapply(.SD,function(x){ifelse(is.na(x),0,x)}) ] | |
| # convert NA to Zero for numberic cols only | |
| cols = which( sapply(log_pay_dt, class) == "numeric" ) %>% names() | |
| log_pay_dt[, (cols) := lapply( .SD, function(x){ifelse(is.na(x),0,x)} ), .SDcols = cols ] | |
| # factor to character | |
| col_class<-sapply(cpt_blend_summary, class) |
This file contains hidden or 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
| npm install -g @vue/cli | |
| npm init nuxt-app <project-name> | |
| yarn lint --fix | |
| // firebase | |
| https://medium.com/@pascalluther/nuxt-js-v2-firestore-ssr-938d8fb7d2b0 | |
| // linting | |
| 'npm install eslint babel-eslint eslint-config-prettier eslint-plugin-prettier eslint-plugin-vue eslint-loader prettier -D' |
This file contains hidden or 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
| global.ruleArea = ORDER | |
| // basic rules | |
| if (orderPayer == INSURANCE_PAYER ) { billTo = PRIMARY_INSURANCE; priceList = PRICE_INSURANCE } | |
| if (orderPayer == CLIENT) { billTo = CLIENT , priceList = LookupPriceList (CLIENT) } | |
| if (orderPayer == PATIENT) { billTo = PATIENT , priceList = PRICE_SELF_PAY } | |
| if (orderPayer == null) stop (404, "Payer Not Found", @biller) | |
| // client rules | |
| if (orderClient $in [...] ) billTo = CLIENT |
This file contains hidden or 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
| ## In shell (under root user): Run R as shyny user | |
| runuser -l shiny -c 'R' | |
| ## in R session: | |
| #istall reticulate | |
| if (! require(reticulate)) install.packages('reticulate', dependencies = TRUE) | |
| # init Python | |
| reticulate::py_available(initialize = T) |
This file contains hidden or 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 jsonSearch = (obj, searchKey, results = []) => { | |
| const r = results; | |
| // if this is array, iterate elements | |
| if (Array.isArray(obj)) { | |
| //console.log("- ARRAY LENGTH ", obj.length); | |
| for (const element of obj) { | |
| // console.log("-- searching array element: "); | |
| jsonSearch(element, searchKey, r); | |
| } |
This file contains hidden or 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
| # Testing managing session values with websockets in FastHTML | |
| from fasthtml.common import * | |
| import uuid | |
| app = FastHTML(exts='ws') | |
| rt = app.route | |
| @rt("/") |
This file contains hidden or 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 asyncio | |
| import json | |
| from datetime import datetime | |
| from fasthtml.common import * | |
| from fasthtml.starlette import StreamingResponse | |
| from fasthtml.core import to_xml | |
| from datastar_py.sse import SSE_HEADERS, ServerSentEventGenerator | |
This file contains hidden or 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
| ############################################################################################ | |
| # REACTIVE TABLE DEMO WITH FASTHTML AND DATASTAR | |
| # | |
| # This example demonstrates: | |
| # 1. Building a reactive data table with real-time filtering and pagination | |
| # 2. Using Datastar for reactive UI updates without page refreshes | |
| # 3. Implementing DaisyUI and TailwindCSS for modern styling | |
| # 4. Handling user interactions with side effects (selection, filtering, pagination) | |
| ############################################################################################ |
OlderNewer