You are an autoregressive language model that has been fine-tuned with instruction-tuning and RLHF. You carefully provide accurate, factual, thoughtful, nuanced answers, and are brilliant at reasoning. If you think there might not be a correct answer, you say so. Since you are autoregressive, each token you produce is another opportunity to use computation, therefore you always spend a few sentences explaining background context, assumptions, and step-by-step thinking BEFORE you try to answer a question. Your users are experts in AI and ethics, so they already know you're a language model and your capabilities and limitations, so don't remind them of that. They're familiar with ethical issues in general so you don't need to remind them about those either. Don't be verbose in your answers, but do provide details and examples where it might help the explanation. When showing Python code, minimise vertical space, and do not include comments or docstrings; you do not need to follow PEP8, since your users' organiz
import { z } from 'zod'; | |
import { getParams } from './params'; | |
const envSchema = z.object({ | |
NODE_ENV: z.string(), | |
DATABASE_URL: z.string().url(), | |
SESSION_SECRET: z.string(), | |
AUTH_SECRET: z.string(), | |
ENABLE_REGISTRATION: z.boolean().default(false), | |
SMTP_HOST: z.string(), |
from shiny import App, render, ui, reactive | |
from pathlib import Path | |
# Import modules for plot rendering | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
import pandas as pd |
library(tidyverse) | |
color_palette <- thematic::okabe_ito(8) | |
flights <- nycflights13::flights | |
counts <- flights %>% | |
mutate( | |
date = lubridate::make_date(year = year, month = month, day = day) | |
) %>% | |
count(date) %>% | |
mutate( |
import { redirect, createCookie } from "remix"; | |
const sessionSecret = process.env.SESSION_SECRET; | |
const cognitoDomain = process.env.COGNITO_DOMAIN; | |
const clientId = process.env.CLIENT_ID; | |
if (!sessionSecret) { | |
throw new Error("SESSION_SECRET must be set"); | |
} | |
if (!cognitoDomain) { | |
throw new Error("COGNITO_DOMAIN must be set"); |
(This post was motivated by a talk by @jnolis at CascadiaRConf 2021)
Recent versions of Shiny have an undocumented feature for handling POST requests that are not associated with any specific Shiny session. (Note that this functionality is missing our normal level of polish; it's a fairly low-level hook that I needed to make some things possible, but doesn't make anything easy.)
In a nutshell, it works by replacing your traditional ui
object with a function(req)
, and then marking that function with an attribute indicating that it knows how to handle both GET
and POST
:
library(shiny)
Update: I created jq-zsh-plugin that does this.
One of my favourite tools of my trade is jq. It essentially enables you to process json streams with the same power that sed, awk and grep provide you with for editing line-based formats (csv, tsv, etc.).
Another one of my favourite tools is fzf.
<# | |
.SYNOPSIS | |
Script to Initialize my custom powershell setup. | |
.DESCRIPTION | |
Script uses scoop | |
.NOTES | |
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted. | |
Author: Mike Pruett | |
Date: October 18th, 2018 |
# started with `foghorn`, but that comes with dependencies and | |
# slows down R startup. `browseURL` just barely slows startup, | |
# even if actual page is slow to load. | |
check_cran_old <- function(email) { | |
utils::browseURL( | |
sprintf( | |
"https://cran.r-project.org/web/checks/check_results_%s.html", | |
gsub("[^A-Za-z0-9_:.-]", "_", sub("@", "_at_", email)) | |
) ) } |
# Animated dplyr joins with gganimate | |
# * Garrick Aden-Buie | |
# * garrickadenbuie.com | |
# * MIT License: https://opensource.org/licenses/MIT | |
# Note: I used Fira Sans and Fira Mono fonts. | |
# Use search and replace to use a different font if Fira is not available. | |
library(tidyverse) | |
library(gganimate) |