Skip to content

Instantly share code, notes, and snippets.

@dtenenba
dtenenba / gist:4733384
Created February 7, 2013 19:18
Element click handling in cytoscape.js
cy.on('click', function(event){
// cyTarget holds a reference to the originator
// of the event (core or element)
var evtTarget = event.cyTarget;
window.evtTarget = evtTarget;
if( evtTarget === cy ){
console.log('click on background');
} else {
console.log('click on some element');
# print() is the simplest debugging technique
myFunction <- function()
{
#...possibly buggy code...
print("here i am")
#...more possibly buggy code...
print("here i am 2")
}
library(httr)
myRunApp <- function(...)
{
try(hostname <- suppressWarnings(system2(c("hostname", "-d"),
stdout=TRUE, stderr=NULL)),
silent=TRUE)
if (exists("hostname") && length(hostname) &&
grepl("ec2\\.internal", hostname))
{
dots <- list(...)
console.log("here we are in demo.js");
var myCallbackFunction = function( nRow, aData, iDisplayIndex ) {
console.log("in row callback function");
return nRow;
}
$(function() {
console.log("in document ready function");
});
@dtenenba
dtenenba / demo.R
Last active January 2, 2016 13:49
library(shiny)
addResourcePath("js", "/tmp/shinydemo")
runApp(list(
ui = basicPage(
tagList(singleton(
tags$head(
tags$script(src="js/shiny2.js"),
tags$script(src="js/demo.js")
--- /Users/dante/Downloads/shiny/inst/www/shared/shiny.js 2013-10-29 11:36:43.000000000 -0700
+++ shiny2.js 2014-01-07 21:53:53.000000000 -0800
@@ -1,3 +1,4 @@
+console.log("in shiny2.js");
/*jshint browser:true, jquery:true, strict:false, curly:false, indent:2*/
(function() {
@@ -1214,7 +1215,8 @@
"aaSorting": [],
"bSortClasses": false,
ruby_block "block1" do
block do
node.run_state['url'] = "https://google.com"
end
action :create
end
remote_file "/tmp/url" do
source node.run_state['url']
$ R CMD BiocCheck KEGGREST_1.1.1.tar.gz
* This is BiocCheck, version 1.1.7.
* BiocCheck is a work in progress. Output and severity of issues may
change.
* Installing package...
* This is a software package, checking vignette directories...
* # of chunks: 23, # of eval=FALSE: 1 (4%)
* Checking version number...
* Checking biocViews...
* RECOMMENDED: Use valid biocViews. Invalid ones: ConnectTools
biocLite("gfinak/BioC2015OpenCyto", dependencies=TRUE, build_vignettes=TRUE, INSTALL_opts="--no-resave-data")
library(devtools)
install_url("http://s3.amazonaws.com/opencytoworkshop/BioC2015OpenCyto_1.0.tar.gz")