⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains 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
# Function to get data over to PostgreSQL quickly and with minimal loss | |
# of information due to data type conversions. | |
# Note that I have had cases where the pipe() call returned an error due | |
# to lack of memory. So care should be taken with this function | |
dbWriteTable.fast <- function (conn,name,value,row.names=FALSE, | |
overwrite=TRUE,fix.names=TRUE) { | |
# Conform names to PostgreSQL requirements | |
pg.names <- make.db.names(conn,names(value)) | |
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications
like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html
This file contains 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
# First install tmux | |
brew install tmux | |
# For mouse support (for switching panes and windows) | |
# Only needed if you are using Terminal.app (iTerm has mouse support) | |
Install http://www.culater.net/software/SIMBL/SIMBL.php | |
Then install https://bitheap.org/mouseterm/ | |
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
This file contains 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
dataset = [] | |
w = 500 | |
h = 400 | |
padding = 30 | |
dataset.push [ Math.random() * w, Math.random() * h ] for [0..50] | |
svg = d3.select("body") | |
.append("svg") | |
.attr("width", w) |
This file contains 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
LinearizeNestedList <- function(NList, LinearizeDataFrames=FALSE, | |
NameSep="/", ForceNames=FALSE) { | |
# LinearizeNestedList: | |
# | |
# https://sites.google.com/site/akhilsbehl/geekspace/ | |
# articles/r/linearize_nested_lists_in_r | |
# | |
# Akhil S Bhel | |
# | |
# Implements a recursive algorithm to linearize nested lists upto any |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
max_plots <- 5 | |
ui <- fluidPage( | |
headerPanel("Dynamic number of plots"), | |
sidebarPanel( | |
sliderInput("n", "Number of plots", value=1, min=1, max=5) | |
), |
MOVED TO: https://delicious.com/reinholdsson
Primarily R and JavaScript links. Collection maintained by Thomas Reinholdsson.
--- Todo: Move to github page and structure up ---
This file contains 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
# We first start by creating a way of escaping the characters that have special | |
# meaning for html, while making sure we don't end up double-escaping at any | |
# point. The easiest way to do this is to create an S3 class that allows us to | |
# distinguish between regular text (that needs escaping) and html (that | |
# doesn't). | |
# | |
# We then write an escape method that leaves html unchanged and escapes the | |
# special characters (&, <, >) in ordinary text. We also add a method for lists | |
# for convenience |
OlderNewer