Skip to content

Instantly share code, notes, and snippets.

View stevecondylios's full-sized avatar

Steve Condylios stevecondylios

View GitHub Profile
@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">

@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.

@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 / GitHub-Tips.md
Last active June 7, 2023 16:26
Advanced GitHub Search Tricks & Tips
@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 / contact-form.md
Last active December 23, 2022 07:33
Tutorial: Create and Deploy a Contact Form to Production in Ruby on Rails 5

Create a Contact Form in Rails 5



2021 UPDATE: some parts of this tutorial are now out of date, please use Create a Contact Form in Rails 6 instead. The rails 5 / gmail version remains below for posterity.






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.

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 / 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:

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)
# 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)