├── LICENSE ├── .gitignore ├── R ├── sysdata.rda └── nothing_matters.R ├── NAMESPACE ├── .Rbuildignore ├── data-raw ├── quotes-txt.R └── quotes.txt ├── man └── nothing_matters.Rd ├── demotivr.Rproj ├── DESCRIPTION ├── LICENSE.md ├── README.md └── README.Rmd /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2019 2 | COPYRIGHT HOLDER: Joran Elias 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | -------------------------------------------------------------------------------- /R/sysdata.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joranE/demotivr/HEAD/R/sysdata.rda -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(nothing_matters) 4 | -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^LICENSE\.md$ 4 | ^data-raw$ 5 | ^README\.Rmd$ 6 | -------------------------------------------------------------------------------- /data-raw/quotes-txt.R: -------------------------------------------------------------------------------- 1 | ## code to prepare `quotes.txt` dataset goes here 2 | quotes <- readLines(con = "data-raw/quotes.txt") 3 | usethis::use_data(quotes,overwrite = TRUE,internal = TRUE) 4 | -------------------------------------------------------------------------------- /man/nothing_matters.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/nothing_matters.R 3 | \name{nothing_matters} 4 | \alias{nothing_matters} 5 | \title{Nothing Matters} 6 | \usage{ 7 | nothing_matters() 8 | } 9 | \description{ 10 | Send demotivational quotes to the console. 11 | } 12 | -------------------------------------------------------------------------------- /demotivr.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageRoxygenize: rd,collate,namespace 22 | -------------------------------------------------------------------------------- /R/nothing_matters.R: -------------------------------------------------------------------------------- 1 | #' Nothing Matters 2 | #' 3 | #' Send demotivational quotes to the console. 4 | #' 5 | #' @export 6 | nothing_matters <- function() { 7 | abuse_level <- getOption("demotivr.abuse_level") 8 | if (is.null(abuse_level)){ 9 | abuse_level <- 0.1 10 | } 11 | if (!is.numeric(abuse_level) || abuse_level < 0 || abuse_level > 1 || is.na(abuse_level)){ 12 | abuse_level <- 0.1 13 | } 14 | if (stats::runif(1) <= abuse_level){ 15 | cat(crayon::green(quotes[sample(x = seq_along(quotes),size = 1)])) 16 | } else{ 17 | invisible(NULL) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: demotivr 2 | Type: Package 3 | Title: Show Demotivational Messages on Errors 4 | Version: 0.1.0 5 | Author: Joran Elias 6 | Maintainer: Joran Elias 7 | Description: More about what it does (maybe more than one line) 8 | Use four spaces when indenting paragraphs within the Description. 9 | License: MIT + file LICENSE 10 | Encoding: UTF-8 11 | LazyData: true 12 | URL: https://github.com/joranE/demotivr 13 | BugReports: https://github.com/joranE/demotivr/issues 14 | Depends: 15 | R (>= 3.4.0) 16 | Imports: 17 | crayon 18 | RoxygenNote: 6.1.1 19 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2019 Joran Elias 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # demotivr 5 | 6 | 7 | 8 | 9 | 10 | demotivr allows the user to display random nihilistic and generally 11 | depressing messages after an error. 12 | 13 | ## Installation 14 | 15 | You can install demotivr from [GitHub](https://github.com/) with: 16 | 17 | ``` r 18 | # install.packages("devtools") 19 | devtools::install_github("joranE/demotivr") 20 | ``` 21 | 22 | ## Usage 23 | 24 | demotivr provides a way to display periodic demotivational messages on 25 | the console whenever an error occurs. You enable this behavior by 26 | setting `options("error")` to: 27 | 28 | ``` r 29 | options(error = demotivr::nothing_matters) 30 | ``` 31 | 32 | in your .Rprofile. The frequency with which demotivational messages are 33 | triggered can be controlled by setting the `demotivr.abuse_level` 34 | option, also in your .Rprofile: 35 | 36 | ``` r 37 | options(demotivr.abuse_level = 0.5) 38 | ``` 39 | 40 | If unset (or if not set to a number between 0 and 1) it will default to 41 | 0.1. 42 | 43 | After this setup, running code that triggers an error will randomly 44 | display an additional message: 45 | 46 | ``` r 47 | > log("a") 48 | Error in log("a") : non-numeric argument to mathematical function 49 | You are never more alone than when you are debugging. 50 | ``` 51 | 52 | ## Related Work 53 | 54 | If abuse is something you seek out, you can also check out the function 55 | `demotivate()` in the package 56 | [dang](https://cran.r-project.org/web/packages/dang/index.html). 57 | 58 | Remember, nothing matters\! 59 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | 6 | 7 | ```{r, include = FALSE} 8 | knitr::opts_chunk$set( 9 | collapse = TRUE, 10 | comment = "#>", 11 | fig.path = "man/figures/README-", 12 | out.width = "100%" 13 | ) 14 | ``` 15 | # demotivr 16 | 17 | 18 | 19 | 20 | demotivr allows the user to display random nihilistic and generally depressing messages after an error. 21 | 22 | ## Installation 23 | 24 | You can install demotivr from [GitHub](https://github.com/) with: 25 | 26 | ``` r 27 | # install.packages("devtools") 28 | devtools::install_github("joranE/demotivr") 29 | ``` 30 | ## Usage 31 | 32 | demotivr provides a way to display periodic demotivational messages on the console whenever an error occurs. 33 | You enable this behavior by setting `options("error")` to: 34 | 35 | ``` r 36 | options(error = demotivr::nothing_matters) 37 | ``` 38 | 39 | in your .Rprofile. The frequency with which demotivational messages are triggered can be controlled by setting 40 | the `demotivr.abuse_level` option, also in your .Rprofile: 41 | 42 | ``` r 43 | options(demotivr.abuse_level = 0.5) 44 | ``` 45 | If unset (or if not set to a number between 0 and 1) it will default to 0.1. 46 | 47 | After this setup, running code that triggers an error will randomly display an additional message: 48 | 49 | ``` r 50 | > log("a") 51 | Error in log("a") : non-numeric argument to mathematical function 52 | You are never more alone than when you are debugging. 53 | ``` 54 | 55 | ## Related Work 56 | 57 | If abuse is something you seek out, you can also check out the function `demotivate()` 58 | in the package [dang](https://cran.r-project.org/web/packages/dang/index.html). 59 | 60 | Remember, nothing matters! 61 | -------------------------------------------------------------------------------- /data-raw/quotes.txt: -------------------------------------------------------------------------------- 1 | Just give up. 2 | It's not worth it, go back to bed. 3 | Don't worry about errors; either way your existence has no meaning. 4 | Your life is a failure. 5 | Why bother? You'll just get another error. 6 | Don't worry! Nothing exists, including this error. 7 | Life is just a bunch of failures and then we die. 8 | No one will notice this bug because no one cares about anything you do. 9 | This error isn't important because nothing matters. 10 | This code is written by an idiot, full of errors, signifying nothing. - W. Shakespeare 11 | What if this is all there is? 12 | Is this really how you want to spend your short, brutal existence? 13 | If you delete all your code, it will run without errors! 14 | Have you tried fixing the error by throwing your computer out the window? 15 | It was probably going to give you the wrong result anyway. 16 | Once you get this code running, your life will still have no meaning. 17 | It's always worse than it seems. 18 | The only thing standing between you and total happiness is that happiness is an illusion. 19 | Remember, your frustration, like everything else, doesn't exist. 20 | The only thing worse than broken code is code that works but no one cares about. 21 | No one cares about this code. They're just pretending. 22 | Is your soul as broken as this code? 23 | Remember, this code is doing *precisely* what you told it to. 24 | Life sucks, then you die. 25 | You are never more alone than when you are debugging. 26 | Whether you like it or not, alone is something you'll be quite a lot! - Dr. Seuss 27 | From the moment we are born, we begin to die. - Janne Teller 28 | Death comes to us all; we can only choose how to face it when it comes. - Robert Jordan 29 | Time doesn't heal all wounds, or fix all bugs. 30 | To perceive is to suffer. - Aristotle 31 | Just starting typing random shit; that might actually work better. 32 | You still haven't fixed it? 33 | Still not working, huh? 34 | Have you tried turning your computer off and then on again? 35 | Think hard on this failure. It will not be your last. 36 | The computer knows what you're trying to do. It's just screwing with you. 37 | There is no spoon. 38 | This is why no one loves you. 39 | You could ask someone for help, but you're all alone, aren't you? 40 | Nothing matters. 41 | In the grand scheme of things, this error is as insignificant as you are. 42 | In 100 years no one will remember anything that you've done, including this error. 43 | Trying is the first step toward failure. 44 | Failure is always an option. 45 | Happiness is an illusion. 46 | Nothing good exists because nothing exists. 47 | Life is meaningless. 48 | Everything is nothing. 49 | Nothing is all there is. 50 | Civilization will end soon and then software bugs won't matter. 51 | It doesn't matter than no one loves you because love is an illusion. 52 | Nothing exists, including this bug, so just ignore it. 53 | There is no hope, because nothing is all there is. 54 | Optimism is just a form of self-delusion. 55 | Don't feel too bad, most other people are failures too. 56 | Mistakes are a normal part of life. (For you.) 57 | Things will only get worse from here. 58 | Pretty soon we'll all be dead, but this code will continue failing forever. 59 | How many times have you tried running the exact same code expecting different results? 60 | No can fail forever. (Probably.) 61 | --------------------------------------------------------------------------------