Skip to content

Instantly share code, notes, and snippets.

Alan Dipert alandipert

Block or report user

Report or block alandipert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
wch / remote_repl.R
Last active Aug 7, 2019
Remote R REPL app with httpuv
View remote_repl.R
PORT <- 7000
app <- list(
call = function(req) {
onWSOpen = function(ws) {
ws$onMessage(function(binary, message) {
jcheng5 /
Last active Aug 7, 2019
Installing R-devel on Solaris 10 VM

As far as CRAN is concerned, there are two flavors of R on Solaris: one that is built using the Solaris Studio compiler, and one that is built using the GNU/gcc toolchain. The latter is far more up-to-date, but if your package requires it, then your DESCRIPTION file must declare that with the line SystemRequirements: GNU make.

These instructions are for configuring, building, and installing R-devel using the GNU/gcc toolchain (only).

You'll need VMWare Fusion on Mac, or VMWare Workstation (?) on Windows/Linux.

Get Solaris VM

Download the Solaris VM provided by Jeroen Ooms:

tyluRp / pkg_size.R
Last active Feb 12, 2019
Check the size of an R package or project
View pkg_size.R
# Check Package Size
# Thanks to Alan Dipert for the help with this one.
# This function is used to calculate size of package and report size in
pkg_size <- function(package) {
root <- find.package(package)
rel_paths <- list.files(root, all.files = TRUE, recursive = TRUE)
abs_paths <- file.path(root, rel_paths)
wch / proxy.R
Last active Feb 22, 2018
Quick and dirty HTTP proxy in R
View proxy.R
req_rook_to_curl <- function(req, host) {
# browser()
# Rename headers. Example: HTTP_CACHE_CONTROL => Cache-Control
r <- as.list(req)
# Uncomment to print out request headers
cat("== Original ==\n")
jcheng5 / create_forked_task.R
Last active Jun 26, 2019
Concurrent, forked, cancellable tasks in Shiny
View create_forked_task.R
# Also uses parallel, shinyjs, tools
# Create a long-running task, executed in a forked process. (Doesn't work on Windows)
# The return value is a promise-like object with three
# methods:
# - completed(): FALSE initially, then TRUE if the task succeeds,
# fails, or is cancelled. Reactive, so when the state changes
# any reactive readers will invalidate.
bcachet / graph.fs
Last active Aug 11, 2017
Kahn sorting in F#
View graph.fs
namespace Graph
// Implementation based on
module Map =
let keys map =
map |> Map.toSeq |> fst |> Set.ofSeq
let values map =
map |> Map.toSeq |> snd |> Set.ofSeq
tanyuan /
Last active Dec 10, 2019
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
tonsky / .profile.boot
Created Mar 2, 2015
boot-clj plugin to report build status to AnyBar
View .profile.boot
(defn- send-udp [s port]
(with-open [socket (]
(let [group ( "localhost")
bytes (.getBytes s)
packet ( bytes (count bytes) group port)]
(.send socket packet)
(.close socket))))
(deftask anybar [p port VAL int "AnyBar port"]
(let [port (or port 1738)]
pandeiro /
Last active Aug 29, 2015
Example of a simple webapp written as a single file


  1. Get Boot
  2. Copy the above file to $HOME/app.boot
  3. $ chmod a+x $HOME/app.boot
  4. $ cd && ./app.boot
View Vagrantfile
# vi: set ft=ruby :
$script = <<SCRIPT
apt-get install -y git maven openjdk-7-jdk
cd /usr/local/bin
wget -O lein
chmod +x lein
You can’t perform that action at this time.