Skip to content

Instantly share code, notes, and snippets.

Avatar

Steve Condylios stevecondylios

View GitHub Profile
View finding-world-population-by-timezone.md

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 Oct 27, 2020
How to Resize an Image in a Github Issue (e.g. Github flavored Markdown)
View resize-image-in-github-issue-github-flavored-markdown.md

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

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">

View init.R
# 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)
View most-viewed-stack-overflow-questions.sql
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 Dec 17, 2019
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
View install-r-and-rstudio-on-windows-with-powershell
$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"
@stevecondylios
stevecondylios / contact-form.md
Last active Oct 27, 2020
Tutorial: Create and Deploy a Contact Form to Production in Ruby on Rails 5
View contact-form.md

Create a Contact Form in Rails 5

This is a complete, step-by-step tutorial showing how to create a fully functional contact form in production in rails 5. Rather than reinvent things, the following borrows from the best available documentation and tutorials (most notably, this tutorial on making a contact form in development). The finished contact form can be viewed here.

This tutorial uses:

  • heroku for deployment,
  • gmail for the mailer, and
  • github for version control

It would be a good idea to create a new gmail account to use for your mailer now, if you haven't already. If you haven't yet got a heroku account and installed the heroku CLI, it would be easiest to do so now.

You can’t perform that action at this time.