Skip to content

Instantly share code, notes, and snippets.

View stevecondylios's full-sized avatar

Steve Condylios stevecondylios

View GitHub Profile
@stevecondylios
stevecondylios / nvim-r.txt
Created January 24, 2024 13:48 — forked from navicore/nvim-r.txt
R cheatsheet and nvim-r commands
Menu entry Default shortcut~
Start/Close
. Start R (default) \rf
. Start R (custom) \rc
--------------------------------------------------------
. Close R (no save) \rq
. Stop (interrupt) R :RStop
-----------------------------------------------------------
@stevecondylios
stevecondylios / gist:fc6fd259af75a2545bfece930e24f57f
Created March 27, 2023 01:03
Full list of packages installed on ubuntu-latest GitHub Action (found via `apt list --installed`)
Listing...
acl/jammy,now 2.3.1-1 amd64 [installed]
adduser/jammy,now 3.118ubuntu5 all [installed,automatic]
adoptium-ca-certificates/now 1.0.1-1 all [installed,local]
adwaita-icon-theme/jammy,now 41.0-1ubuntu1 all [installed,automatic]
alsa-topology-conf/jammy,now 1.2.5.1-2 all [installed,automatic]
alsa-ucm-conf/jammy-updates,now 1.2.6.3-1ubuntu1.4 all [installed,automatic]
ant-optional/jammy,now 1.10.12-1 all [installed]
ant/jammy,now 1.10.12-1 all [installed]
apache2-bin/jammy-updates,jammy-security,now 2.4.52-1ubuntu4.4 amd64 [installed,automatic]
@stevecondylios
stevecondylios / GitHub-Tips.md
Last active June 7, 2023 16:26
Advanced GitHub Search Tricks & Tips
@stevecondylios
stevecondylios / distribution-of-paragraph-length.md
Last active June 5, 2022 05:48
Are paragraph lengths normally distributed?

Question: Does paragraph length follow a normal distribution?

Many naturally occurring things follow a normal distribution.

I'm curious to know if paragraphs follow a normal distribution too?

Note: paragraph length could be measured in characters, or words.

Answer:

@stevecondylios
stevecondylios / contact-form-rails-6.md
Last active April 2, 2024 15:50
Create a Contact Form in Rails 6

How to make a contact form in rails 6

This is a quick walk through on how to:

  1. make a contact form in rails 6,
  2. test it locally, and
  3. move it into production using heroku and the MailGun addon

This uses the free heroku and mailgun plans. If you get stuck on any part, check the full code here.

Here we find world population by timezone (from an extremely reliable source: an online quiz).

First, we can try using rvest to grab the results. But there's a problem, we need to actually play the quiz in order for the UTC offsets to appear on page.

i.e.

library(tidyverse)
library(rvest)
@stevecondylios
stevecondylios / resize-image-in-github-issue-github-flavored-markdown.md
Last active April 15, 2024 10:43
How to Resize an Image in a Github Issue (e.g. Github flavored Markdown)

How to Resize an Image in Github README.md (i.e. Github Flavored Markdown)

Percentage:

<img src="https://user-images.githubusercontent.com/16319829/81180309-2b51f000-8fee-11ea-8a78-ddfe8c3412a7.png" width=50% height=50%>

Pixels:

<img src="https://user-images.githubusercontent.com/16319829/81180309-2b51f000-8fee-11ea-8a78-ddfe8c3412a7.png" width="150" height="280">

# init.R
#
# Example R code to install packages if not already installed
#
my_packages = c("tidyverse", "shiny")
install_if_missing = function(p) {
if (p %in% rownames(installed.packages()) == FALSE) {
install.packages(p)
SELECT
'https://stackoverflow.com/questions/' + CONVERT(VARCHAR, Posts.Id) as url,
(
ViewCount / (SELECT -DATEDIFF(DAY, GETDATE() , CreationDate))
) AS ave_views_per_day,
*
FROM
Posts
LEFT JOIN PostTags ON Posts.Id = PostTags.PostId
LEFT JOIN Tags ON PostTags.TagId = Tags.Id
@stevecondylios
stevecondylios / install-r-and-rstudio-on-windows-with-powershell
Last active December 17, 2019 01:22
Powershell script to install both R and RStudio on Windows. NOTE: there are a couple of links in the script below - update them to ensure you install most recent versions
$dir = $env:TEMP;
Set-Location $dir
$urlRStudio = "https://download1.rstudio.org/desktop/windows/RStudio-1.2.1335.exe"
$outputRStudio = "$dir\RStudio.exe"
$wcRStudio = New-Object System.Net.WebClient
$wcRStudio.DownloadFile($urlRStudio, $outputRStudio) # $PSScriptRoot
$urlR = "https://cran.r-project.org/bin/windows/base/R-3.6.0-win.exe"