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
| FOR /f "tokens=*" %i IN ('docker ps -a -q') DO docker rm %i |
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
| library(tidyverse) | |
| ### criando 300 váriáveis normais para 20 diferentes | |
| ### pares de média e variância distintos | |
| set.seed(42) | |
| df <- tibble( | |
| grupo = purrr::map_chr(1:100, ~paste('grupo_', ., sep = '')), | |
| true_mean = runif(100), | |
| true_variance = runif(100), |
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/bin/env bash | |
| # This template comes from https://dev.to/thiht/shell-scripts-matter | |
| { | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| #/ Usage: | |
| #/ Description: | |
| #/ Examples: |
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
| free -m | |
| echo 3 | sudo tee /proc/sys/vm/drop_caches | |
| free -m |
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
| # stole from https://askubuntu.com/questions/17823/how-to-list-all-installed-packages | |
| (zcat $(ls -tr /var/log/apt/history.log*.gz); cat /var/log/apt/history.log) 2>/dev/null | | |
| egrep '^(Start-Date:|Commandline:)' | | |
| grep -v aptdaemon | | |
| egrep '^Commandline:' |
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
| #A couple of decent regular expressions to find URLs and email addresses | |
| urlRe = re.compile(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+') | |
| #See http://www.regular-expressions.info/email.html | |
| emailRe = re.compile(r'[a-zA-Z0-9+_\-\.]+@[0-9a-zA-Z][.-0-9a-zA-Z]*\.[a-zA-Z]+') | |
| someString = "Lorem ipsum dolor http://google.com/ consectetuer elit. Aliquam \ | |
| scelerisque felis. Nulla lacinia - info@subdomain.mah.se. Suspendisse elementum \ | |
| lacus. Suspendisse potenti. Etiam et id lorem congue aliquam. Aenean venenatis, \ | |
| elit commodo pretium aliquet, dolor webmaster@yahoo.com, ut iaculis est ante at \ |
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
| ## http://www.unofficialgoogledatascience.com/2015/08/an-introduction-to-poisson-bootstrap26.html | |
| n <- 10000000 | |
| data <- rnorm(n, mean = 4, sd = 2) | |
| matrix_col_as_vector <- . %>% as.list() %>% purrr::as_vector() | |
| boot_delta_mean <- function(id, data){ | |
| mean_data <- mean(data) | |
| indicator <- |
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
| # https://www.reddit.com/r/linux/comments/1u0d8s/dtrx_a_versatile_tool_to_easily_extract_tar_zip/ | |
| extract () { | |
| if [ -f $1 ] ; then | |
| case $1 in | |
| *.tar.bz2) tar xvjf $1 && cd $(echo $1 | sed 's/.tar.bz2//') ;; | |
| *.tar.gz) tar xvzf $1 && cd $(echo $1 | sed 's/.tar.gz//') ;; | |
| *.bz2) bunzip2 $1 && cd $(echo $1 | sed 's/.bz2//') ;; | |
| *.rar) unrar x $1 && cd $(echo $1 | sed 's/.rar//') ;; | |
| *.gz) gunzip $1 && cd $(echo $1 | sed 's/.gz//') ;; |
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
| library(dplyr) | |
| tibble( | |
| prob = seq(0, 1, 0.01), | |
| complement = 1 - prob, | |
| odds_ratio = prob/complement, | |
| log_odds_ratio = log(odds_ratio) | |
| ) %>% | |
| arrange(-abs(log_odds_ratio)) %>% |
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
| import string | |
| letras = string.ascii_lowercase | |
| texto = input('Digite o seu texto: ').lower() | |
| k = int(input('Digite a quantidade de vezes que o seu texto se deslocará: ')) | |
| chave = {letra:letras[(i + k) % len(letras)] for i, letra in enumerate(letras + ' ')} |
OlderNewer