Skip to content

Instantly share code, notes, and snippets.

@richardblondet
richardblondet / README.md
Last active May 3, 2024 10:02
Create a simple API backend with Google App Script and a Spreadsheet

Google App Script CRUD

Inspired by this gist.

Getting Started

  1. Create a new App Script project.
  2. Paste the content of the file google-app-script-crud.gs in the default Code.gs file.
  3. Create a new Spreadsheet.
  4. Copy the Spreadsheet ID found in the URL into the variable SHEET_ID located in line 1 of your file.
@richpauloo
richpauloo / README.md
Last active December 24, 2019 01:43
Cumulative Variable Importance for Random Forest Models

Cumulative Variable Importance for Random Forest (RF) 🌲🌳 Models

Motivation

What does an interpretable RF visualization look like? Out-of-the-box 📦 RF implementations in R and Python compute variable importance over all trees, but how do we get there?

In other words, what would a cumulative variable importance for a RF look like?

Approach

@hjbotha
hjbotha / free_ports.sh
Last active June 4, 2024 15:57
Free ports 80 and 443 on Synology NAS
#! /bin/bash
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION
# Developed for DSM 6 - 7.0.1. Not tested on other versions.
# Steps to install
# Save this script in one of your shares
# Edit it according to your requirements
# Backup /usr/syno/share/nginx/ as follows:
# # cd /usr/syno/share/
# # tar cvf ~/nginx.tar nginx
@fuzziebrain
fuzziebrain / sql.bat
Created January 8, 2018 15:48
Oracle SQLcl sql.bat fixed
@echo off
REM ########################################################################
REM # (@)sql.bat
REM #
REM # Copyright 2014 by Oracle Corporation,
REM # 500 Oracle Parkway, Redwood Shores, California, 94065, U.S.A.
REM # All rights reserved.
REM #
REM # This software is the confidential and proprietary information
REM # of Oracle Corporation.
@nacnudus
nacnudus / data.table-joins.R
Created August 21, 2017 09:20
How to do joins with data.table
library(data.table)
?`[.data.table`
DT <- data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6), v=1:9)
X <- data.table(x=c("c","b"), v=8:7, foo=c(4,2))
colnames(DT)
# [1] "x" "y" "v"
@upsuper
upsuper / bind-backup.sh
Last active March 13, 2024 17:08
Script to automatically bind and unbind external USB drive on Synology NAS
#!/bin/bash
SERIAL="00000000"
echo "Looking for device with serial $SERIAL..."
for d in /sys/bus/usb/devices/*-*; do
if [[ -f "$d/serial" ]]; then
serial=$(<"$d/serial")
if [[ "$serial" = "$SERIAL" ]]; then
device="$(basename $d)"
@Pakillo
Pakillo / Rprogramming-syllabus.md
Last active September 13, 2016 15:32 — forked from hadley/curriculum.md
R programming syllabus by Hadley Wickham

Notes:

  • I've tried to break up in to separate pieces, but it's not always possible: e.g. knowledge of data structures and subsetting are tidy intertwined.

  • Level of Bloom's taxonomy listed in square brackets, e.g. http://bit.ly/15gqPEx. Few categories currently assess components higher in the taxonomy.

Programming R curriculum

Data structures

@Pakillo
Pakillo / git-github-tutorials.md
Last active July 8, 2023 13:51
Git & GitHub tutorials
@brodieG
brodieG / data.table.standard.eval.R
Last active April 8, 2020 11:02
Corner Cases With Non-Standard Evaluation in data.table
# Because there is no way to tell data.table
# "interpret this variable as a column name", it's possible to come up
# with corner cases. I'll grant these are unlikely to occur in day
# to day use, but any function that uses `data.table` must account for
# them
# Low odds, and yes, there are workarounds, but this is
# what I mean by you have to think carefully to avoid
# corner cases
# here's some sample data to test it out
require(data.table)
require(dplyr)
set.seed(45)
DF <- data.frame(x=sample(3, 25, TRUE), y=1:25, z=26:50)
DP <- tbl_df(DF) # for DPLYR data.frame object
DT <- data.table(DF)
# 1) row-wise subset (usually based on conditions):