Skip to content

Instantly share code, notes, and snippets.

@Fil
Fil / .block
Last active February 2, 2025 02:38
Fabio Crameri’s Colormaps
license: mit
@adilapapaya
adilapapaya / examples.R
Last active August 29, 2015 14:19 — forked from skranz/s_dplyr
# Examples
library(dplyr)
source("s_dplyr.R");
# Original usage of dplyr
mtcars %>%
filter(gear == 3,cyl == 8) %>%
select(mpg, cyl, hp:vs)
# Select user specified cols.
@miguelmota
miguelmota / base64-to-png.js
Created September 24, 2014 21:33
Base64 to PNG in Node.js
var fs = require('fs');
var path = require('path');
function base64ToPNG(data) {
data = data.replace(/^data:image\/png;base64,/, '');
fs.writeFile(path.resolve(__dirname, '../tmp/image.png'), data, 'base64', function(err) {
if (err) throw err;
});
}
@mbostock
mbostock / .block
Last active September 11, 2024 10:57
Prim’s Algorithm III
license: gpl-3.0
@adilapapaya
adilapapaya / README.md
Created March 31, 2014 19:42
A Better Meteor Template

The Setup

Note: app-name corresponds to the name of your app

Create the app
meteor create app-name
cd app-name
rm app-name* 
@adilapapaya
adilapapaya / README
Last active November 12, 2024 01:40
Export Table Data to CSV using Javascript
Example code for exporting data in a table to a csv file.
@skranz
skranz / s_dplyr
Created March 21, 2014 07:48
Wrappers to dplyr's data modification functions like arrange, select,... that work with string arguments.
# Helper functions that allow string arguments for dplyr's data modification functions like arrange, select etc.
# Author: Sebastian Kranz
# Examples are below
#' Modified version of dplyr's filter that uses string arguments
#' @export
s_filter = function(.data, ...) {
eval.string.dplyr(.data,"filter", ...)
}
@low-decarie
low-decarie / dual_dendogram_tile_plot
Last active July 21, 2023 22:17
Given a data matrix, this produces a tile plot with dendograms for each axis
dual_dendogram_tile_plot <- function(data.matrix, main="Title"){
#Dual dendrogram ############
x <- data.matrix
dd.col <- as.dendrogram(hclust(method="ward",dist(x)))
col.ord <- order.dendrogram(dd.col)
dd.row <- as.dendrogram(hclust(method="ward",dist(t(x))))
row.ord <- order.dendrogram(dd.row)
@ianstormtaylor
ianstormtaylor / no-olark.css
Created May 7, 2013 18:47
A quick snippet to hide the Olark chat module on certain pages.
/**
* Hide Olark.
*/
#habla_beta_container_do_not_rely_on_div_classes_or_names {
display: none;
}