Skip to content

Instantly share code, notes, and snippets.

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(...)
# print() is the simplest debugging technique
myFunction <- function()
{
#...possibly buggy code...
print("here i am")
#...more possibly buggy code...
print("here i am 2")
}
@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');