Skip to content

Instantly share code, notes, and snippets.

View dpastoor's full-sized avatar

Devin Pastoor dpastoor

  • A2-Ai
  • Rockville, MD
View GitHub Profile
This is the empty file you have to create in traefik/certificates.json, as mentioned in Traefik's docker-compose.yml file
This file will contain your private keys, so remember to perform a 'chmod 600' on it or else Traefik won't store anything in it
@mholt
mholt / macapp.go
Last active April 8, 2024 17:54
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
#!/bin/bash
SCALE=100
LOOPS=3
DURATION=7200
PGBENCH_SEED=2018
for loop in $(seq 1 ${LOOPS}) ; do
echo "doing loop $loop ..."
@hrbrmstr
hrbrmstr / heroku-pg.r
Last active October 25, 2021 01:15
Connect R (#rstats) to heroku PostgreSQL — https://www.heroku.com/postgres
library(processx)
library(RPostgres)
library(httr)
library(dbplyr)
library(tidyverse)
# this example assumes you've created a heroku postgresql
# instance and have the app name (in this example, "rpgtestcon").
# use the heroku command-line app
tweet_shot("947082036019388416")
# or tweet_shot("https://twitter.com/jhollist/status/947082036019388416")
library(tidyverse)
library(lubridate)
url1 <- "https://cran.rstudio.com/src/contrib/Meta/archive.rds"
url2 <- "https://cran.rstudio.com/src/contrib/Meta/current.rds"
if (!file.exists(basename(url1))) download.file(url1, basename(url1), quiet = TRUE)
if (!file.exists(basename(url2))) download.file(url2, basename(url2), quiet = TRUE)
archive <- readRDS("archive.rds")
@cstockton
cstockton / cancellation.go
Created September 16, 2017 16:14
Example of cancellation.
package main
import (
"context"
"fmt"
"log"
"os"
"os/signal"
"syscall"
"time"
@jimhester
jimhester / 0.9.3.png
Last active July 11, 2018 11:18
Run R code with different versions of package dependencies, this will work in the same session as long as you don't run into issues unloading the namespaces
0.9.3.png
@tkh44
tkh44 / Animation.jsx
Last active September 13, 2022 01:31
react-router v4 animated with data-driven-motion
import React from 'react'
import { BrowserRouter as Router, Route, Link, Redirect, matchPath } from 'react-router-dom'
import { Motion } from 'data-driven-motion' // https://github.com/tkh44/data-driven-motion
const WOBBLY_SPRING = { stiffness: 200, damping: 15, precision: 0.1 }
const AnimationExample = () => (
<Router>
<div>
<ul>
N = 10
λ=-0.1; tEnd=1000.
tThreshold = 0.1
u0 = zeros(4 * N)
for i in 1 : N
u0[2*i - 1] = -5. + 10.*rand()
u0[2*i] = -5. + 10.*rand()
u0[2*N + 2*i - 1] = 0.
u0[2*N + 2*i] = 1.
end