Skip to content

Instantly share code, notes, and snippets.

Avatar

yonicd

View GitHub Profile
@yonicd
yonicd / mycode.js
Created Jul 22, 2016 — forked from markheckmann/mycode.js
client/server interaction with shiny - part 3 (separate JS file)
View mycode.js
// Execute function body when the HTML document is ready
$(document).ready(function() {
// javascript code to send data to shiny server
document.getElementById("mydiv").onclick = function() {
var number = Math.random();
Shiny.onInputChange("mydata", number);
};
@yonicd
yonicd / .block
Last active Mar 9, 2017
spline editor with animation
View .block
license: mit
@yonicd
yonicd / html2tagList.R
Last active Apr 3, 2020
convert raw html to htmltools::tagList
View html2tagList.R
#'@title html2tagList
#'@description convert raw html to htmltools tagList
#'@param x character vector of html
#'@examples
#'
#'x<-'<h1>Title</h1>
#' <h2>Header text</h2>
#' <p>Text here</p>
#' <h1>Title</h1>
#' <h2>Header text</h2>
@yonicd
yonicd / .block
Created Mar 30, 2017
fresh block
View .block
license: mit
View .block
license: mit
View .block
license: mit
View example_jstree_widget.html
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
@yonicd
yonicd / jstree_icon2.html
Created Jun 1, 2017
jstree icon tag attempt
View jstree_icon2.html
<div id="htmlwidget-9f0eb65ab1d8850629a1" style="width:960px;height:500px;" class="jsTree html-widget"></div>
<script type="application/json" data-for="htmlwidget-9f0eb65ab1d8850629a1">{"x":{"data":[{"text":"root","children":[{"text":".","children":[{"text":".git","children":[{"text":"branches","icon":"fa fa-file-o","state":[]},{"text":"hooks","icon":"fa fa-file-o","state":[]},{"text":"info","icon":"fa fa-file-o","state":[]},{"text":"logs","children":[{"text":"refs","children":[{"text":"heads","icon":"fa fa-file-o","state":[]},{"text":"remotes","children":[{"text":null,"icon":"fa fa-file-o","state":[]},{"text":"origin","icon":"fa fa-file-o","state":[]}]}]}]},{"text":"objects","children":[{"text":null,"icon":"fa fa-file-o","state":[]},{"text":"01","icon":"fa fa-file-o","state":[]},{"text":"04","icon":"fa fa-file-o","state":[]},{"text":"05","icon":"fa fa-file-o","state":[]},{"text":"06","icon":"fa fa-file-o","state":[]},{"text":"09","icon":"fa fa-file-o","state":[]},{"text":"0c","icon":"fa fa-file-o","state":[]
@yonicd
yonicd / XMLHttpRequest.R
Created Jun 5, 2017
testing XMLHttpRequest in windows
View XMLHttpRequest.R
library(htmltools)
browsable(
tagList(
tags$pre(id="myPreview"),
tags$script(
'
var uri="https://raw.githubusercontent.com/yonicd/jsTree/master/README.md?raw=true";
loadXMLDoc(uri);
@yonicd
yonicd / console_in_widget.R
Last active Jun 5, 2017
show active console with log, warnings and errors during within widget during widget run
View console_in_widget.R
library(htmltools)
browsable(
tagList(
tags$pre(id="myPreview"),
tags$script("
var log = document.querySelector('#myPreview');
['log','debug','info','warn','error'].forEach(function (verb) {
console[verb] = (function (method, verb, log) {
return function () {
method.apply(console, arguments);