population = rnorm(1000, mean = 10, sd = 1)
samples = replicate(100, sample(population, size = 10))
ext.confid.interval = function(s, mu){
confid.intervals = apply(s, 2, t.test, mu = mu)
n.samples = dim(s)[2]
lower.bound = vapply(confid.intervals, function(x) x$conf.int[1], FUN.VALUE = 100)
upper.bound = vapply(confid.intervals, function(x) x$conf.int[2], FUN.VALUE = 100)
library(ggplot2)
library(patchwork)
library(tidyr)
library(magrittr)
library(dplyr)
datasets::anscombe
#> x1 x2 x3 x4 y1 y2 y3 y4
#> 1 10 10 10 8 8.04 9.14 7.46 6.58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# when installing redis from brew, it doesn't come with `utils` folder | |
# and because of which it's rather difficult to run redis cluster locally | |
# (`utils` folder has `create-cluster` script files, which automate the creation | |
# startup, stopping of redis cluster) | |
# this script is a workaround for that, basically, it checks if `utils` folder is | |
# there or not, if not, it downloads it and makes the necessary changes | |
# it assumes, you are running this on macos, with zsh shell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
is_python_project() { | |
local dir=$1 | |
local filename | |
filename=$(basename "$dir") | |
# assumes a directory is a python project, if it has files which are usually found in python project root directory like | |
# requirements.txt, pyproject.toml and setup.py | |
if [[ -f "$dir"/requirements.txt || -f "$dir"/pyproject.toml || -f "$dir"/setup.py || "$filename" == *.py ]]; then | |
echo "${dir} is a python project" | |
return 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/env/bin bash | |
# Create a new route in a svelte project | |
# User provide the route name and the script will create a new | |
# folder with the route name and the +page.svelte file and +page.server.ts file | |
# in the route directory throws error if the directory already exists | |
# This is intended to be run from the `src/routes` directory | |
# Usage: svelte-route -r <route-name> -l <language> | |
function create_svelte_file() { |