Skip to content

Instantly share code, notes, and snippets.

@leungi
leungi / shiny_updateTextInput_module.R
Created May 13, 2021 22:09 — forked from strboul/shiny_updateTextInput_module.R
Shiny updateTextInput between modules by passing the session object in between
library(shiny)
# MODULES ----------------------------------------------------------------------
text_ui <- function(id) {
ns <- shiny::NS(id)
shiny::tagList(
textInput(ns("text"), "Write here"),
verbatimTextOutput(ns("display"))
)
@leungi
leungi / gist:dc3c4b6d16b7a42386a52f8391f956ee
Created October 22, 2020 22:44 — forked from zerolab/gist:1633661
Convert smart quotes with regular ones (and vice-versa)
<?php
//Quotes: Replace smart double quotes with straight double quotes.
//ANSI version for use with 8-bit regex engines and the Windows code page 1252.
preg_replace('[\x84\x93\x94]', '"', $text);
//Quotes: Replace smart double quotes with straight double quotes.
//Unicode version for use with Unicode regex engines.
preg_replace('[\u201C\u201D\u201E\u201F\u2033\u2036]', '"', $text);