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
from typing import Optional
import base64
from passlib.context import CryptContext
from datetime import datetime, timedelta
import jwt
from jwt import PyJWTError
from pydantic import BaseModel
@jcheng5
jcheng5 / README.md
Last active June 26, 2020 01:08
Using a more recent version of jQuery with Shiny

To opt into a more recent version of jQuery, you can add an htmlDependency object pointing to your desired version, somewhere (anywhere) in your UI:

htmltools::htmlDependency("jquery", "3.3.1",
  src = c(href = "https://code.jquery.com/"),
  script = "jquery-3.3.1.min.js")

This example will serve jQuery 3.3.1 from the jQuery CDN. If your app needs to work with clients that won't be able to connect to the wider internet, you'll need to download the jquery-3.3.1.min.js file, put it in an app subdirectory (say, jquery), and point to the directory using the src argument.

---
title: "Using Gensim in R"
author: "Adam Lauretig"
date: "3/17/2018"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

Building pgModeler in MacOS with Homebrew

The official installation instructions for pgModeler recommends installing Xcode and the Enterprise DB distribution of Postgres to fulfill its build requirements. Luckily, Homebrew's got us covered!

  1. Checkout the source

    git clone https://github.com/pgmodeler/pgmodeler.git
    
@markheckmann
markheckmann / remove_password_excel.R
Last active February 4, 2022 05:27
Remove sheet's password protection in Excel
# remove sheet protection in Excel
# Sample file: https://www.dropbox.com/s/4ul0kowrscyr8cz/excel_protected.xlsx?dl=0
library(stringr)
library(zip)
# file with protected sheets
file <- "data/excel_protected.xlsx"
# file name and path after removing protection
@robertdale
robertdale / describe.groovy
Last active September 27, 2019 07:10
JanusGraph Schema Describe Command
// This can be imported via ./bin/gremlin.sh -i describe.groovy
// A variable 'graph' must be defined with a JanusGraph graph
// Run it as a plugin command ':schema'
// :schema describe
//
import org.janusgraph.graphdb.database.management.MgmtLogType
import org.codehaus.groovy.tools.shell.Groovysh
import org.codehaus.groovy.tools.shell.CommandSupport
@aparrish
aparrish / spacy_intro.ipynb
Last active July 27, 2024 14:45
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.