Skip to content

Instantly share code, notes, and snippets.

library(tidyverse)
library(tidyquant)  # For getting financial data from FRED, other places
library(scales)     # For fun things like comma() and percent()

# Get data from FRED
data_raw <- tq_get(c("ICSA",  # Initial unemployment claims
                     "USREC"),  # Recessions
                   get = "economic.data",  # Use FRED
                   from = "1967-01-07")  # From first day of data
@quiver
quiver / cloudformation-template-for-aws-backup-thin-backups.yaml
Created July 20, 2019 17:18
CloudFormation template to configure thin backup rules for AWS Backup
AWSTemplateFormatVersion: "2010-09-09"
Description: "Backup Plan template for thin backups"
Resources:
BackupVaultWithThinBackups:
Type: "AWS::Backup::BackupVault"
Properties:
BackupVaultName: "BackupVaultWithThinBackups"
BackupPlanWithThinBackups:
Type: "AWS::Backup::BackupPlan"
@PurpleBooth
PurpleBooth / Dockerfile
Last active March 21, 2024 09:33
Create a static binary in go and put it in a from scratch docker container
FROM golang:1.9
WORKDIR /go/src/github.com/purplebooth/example
COPY . .
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go
FROM scratch
COPY --from=0 /go/src/github.com/purplebooth/example/main /main
CMD ["/main"]
@turtlemonvh
turtlemonvh / README.md
Created August 8, 2016 18:27
Example vagrant file

Example vagrantfile

With ssh config adding, data directory mounted, provision script setup. 2 CPUs and 4 GB of RAM.

Create a setup bash script at provision/setup.sh and it will be run.

@philippmuench
philippmuench / Dockerfile
Last active April 10, 2021 22:46
packrat inside docker container
# add this line to your Dockerfile (you also need to install Rbase)
RUN R -e 'install.packages("packrat" , repos="http://cran.us.r-project.org"); packrat::restore()'
@subfuzion
subfuzion / curl.md
Last active May 3, 2024 09:26
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@webinista
webinista / RunAProxyOnAmazonEC2VPC.md
Last active April 27, 2024 12:21
Create a proxy server on an Amazon EC2 (VPC) instance

This will create a proxy server in whatever your availability zone your VPC is in. For me, that's us-east-1b. For you, that may be something different. Steps 10+ should more or less work regardless of your provider since those steps cover the setup and configuration of TinyProxy.

  1. Click the Launch Instance button.
  2. Choose Ubuntu Server 14.04 LTS (HVM), SSD Volume Type. This isn't strictly necessary. If you choose another OS, check its documentation for how to install new packages.
  3. On the Choose an Instance Type screen, select t2.micro. It's Free Tier eligible.
  4. Click the Next: ... buttons until you reach the Configure Security Group screen.
    • You may wish to reduce the amount of storage on the Add Storage screen. This is optional.
    • You may wish to add a tag on the Tag Instance screen. This is also optional.
  5. On the Configure Security Group screen:
  • Select Create a new security group.
@aronatkins
aronatkins / install-rstudio-daily.sh
Last active February 10, 2022 08:54
Install RStudio daily build on OSX/macOS or Ubuntu Linux
#!/bin/bash
#
# Installs the latest RStudio daily desktop build for OSX/macOS and Ubuntu(amd64)
#
# https://support.rstudio.com/hc/en-us/articles/203842428-Getting-the-newest-RStudio-builds
set -e
install_macos_daily() {
REDIRECT_URL="https://www.rstudio.org/download/latest/daily/desktop/mac/RStudio-latest.dmg"
@tmaybe
tmaybe / ignore.md
Last active February 7, 2024 03:18
ignoring merge conflicts for specific files in a git repository

How to Ignore Merge Conflicts for Specific Files in a Git Repository

Create a directory and git init it

$ mkdir merge-test
$ cd merge-test/
$ git init
@ashrithr
ashrithr / kerberos_setup.md
Last active March 19, 2024 16:20
Set up kerberos on Redhat/CentOS 7

Installing Kerberos on Redhat 7

This installation is going to require 2 servers one acts as kerberos KDC server and the other machine is going to be client. Lets assume the FQDN's are (here cw.com is the domain name, make a note of the domain name here):

  • Kerberos KDC Server: kdc.cw.com
  • Kerberos Client: kclient.cw.com

Important: Make sure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in