Skip to content

Instantly share code, notes, and snippets.

View Polkas's full-sized avatar

Maciej Nasinski Polkas

  • Warsaw Poland
View GitHub Profile
@psolymos
psolymos / r-apis
Last active April 3, 2023 19:33
Hello world examples with different R web frameworks
# httpuv
library(httpuv)
handle <- function(req) {
input <- req[["rook.input"]]
postdata <- input$read_lines()
jsonlite::toJSON(paste0("Hello ",
jsonlite::fromJSON(paste(postdata)), "!"))
}
httpuv::runServer(
host = "0.0.0.0",
@jwilson8767
jwilson8767 / es6-element-ready.js
Last active February 24, 2025 08:50
Wait for an element to exist. ES6, Promise, MutationObserver
// MIT Licensed
// Author: jwilson8767
/**
* Waits for an element satisfying selector to exist, then resolves promise with the element.
* Useful for resolving race conditions.
*
* @param selector
* @returns {Promise}
*/
@vratiu
vratiu / .bash_aliases
Last active December 4, 2025 09:50
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset