Skip to content

Instantly share code, notes, and snippets.

@wrmack
wrmack / Win11.md
Last active May 7, 2024 09:08
Windows 11 on MacBook M1

Windows 11 on MacBook M1 (ARM)

Steps I went through to install a Windows Insider Preview VHDX on a Macbook Pro using UTM. I needed Windows because I was developing an app to submit to the Microsoft Store. With the following setup I was able to develop an electron-based app and submit it to the Microsoft Store.

  1. Download the VHDX from Windows Insider Previews. You need to register for the Insider Program and sign in.
    • under Select edition select the Canary channel and press Confirm
    • select language and confirm
    • press Download
  2. Open UTM and press + to create a new virtual machine
    • Virtualize
  • Windows
@sub-mod
sub-mod / Entitled_builds.md
Last active June 26, 2023 12:42
Entitled Builds on non-RHEL hosts
@gaborcsardi
gaborcsardi / Pkgdown deploy from Travis.md
Last active November 17, 2021 13:41
Walkthrough: deploy a pkgdown site from Travis

Run usethis::use_pkgdown_travis()

usethis::use_pkgdown_travis()
✔ Setting active project to '/Users/gaborcsardi/works/ps'Adding 'docs/' to '.gitignore'Set up deploy keys by running `travis::use_travis_deploy()`Insert the following code in '.travis.yml'
  before_cache: Rscript -e 'remotes::install_cran("pkgdown")'
@atomize
atomize / _get.sh
Created February 26, 2019 22:03
bash function to download file from web without cURL/wget
# Add this to your .bashrc
# Use it like: you@console_>$ _get https://website.org/file.txt
_get ()
{
IFS=/ read proto z host query <<< "$1"
exec 3< /dev/tcp/$host/80
{
echo GET /$query HTTP/1.1
echo connection: close
echo host: $host
@fnky
fnky / ANSI.md
Last active May 7, 2024 20:16
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@EvilBeaver
EvilBeaver / cleanupJenkinsWorkspaces.groovy
Last active October 18, 2023 10:15 — forked from rb2k/gist:8372402
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;

This snippet shows how you could use later to create an API that can be called on a background thread, to perform an arbitrary task on the main R thread, and return the result to the background thread. The background thread blocks until the result is returned from the main R thread.

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 3, 2024 11:35
Hyperlinks in Terminal Emulators
@jeroen
jeroen / pubkey.R
Created December 7, 2016 14:02
Encrypt using Github public key
github_pubkey <- function(user){
url <- sprintf("https://api.github.com/users/%s/keys", user)
keys <- jsonlite::fromJSON(url)
lapply(keys$key, openssl::read_pubkey)
}
# Get pubkey from Gabor
gabor <- github_pubkey('gaborcsardi')
pubkey <- gabor[[1]] #has 3 keys, use first one
@gaborcsardi
gaborcsardi / cran-over-time.R
Last active July 18, 2020 19:21
Size of the CRAN R package repository over time
library(jsonlite)
## Download
pkgs <- fromJSON("http://crandb.r-pkg.org/-/events")
## Filter
na_pkgs <- unique(pkgs$name[ is.na(pkgs$date) ])
events <- pkgs[ ! pkgs$name %in% na_pkgs, c("date", "name", "event")]