Skip to content

Instantly share code, notes, and snippets.

View cycomachead's full-sized avatar
status

Michael Ball cycomachead

status
View GitHub Profile
@merlinmann
merlinmann / wisdom.md
Last active April 17, 2024 21:52
Merlin's Wisdom Project (Draft)

Merlin's Wisdom Project

Or: “Everybody likes being given a glass of water.”

By Merlin Mann.

It's only advice for you because it had to be advice for me.

@linuxdevops-34
linuxdevops-34 / configure-ec2-instance.md
Created July 17, 2020 09:20 — forked from manojkumararyan/configure-ec2-instance.md
Complete guide for deploying rails application to aws ec2 instance, using capistrano as deploying tool with nginx & puma server

Deploy Rails Application to AWS EC2

Creating AWS EC2 Instance

- login to 'AWS Management Console' (https://aws.amazon.com/console/)
- from 'Services'(in navbar) choose 'EC2'
- from 'Create Instance' section, click on 'Launch Instance'
- then select 'AMI' (Amazon Machine Image), we will be using 'Ubuntu Server 16.04 LTS (HVM)' as example
- select 'Instance Type' as per your requirement
- then click 'Next:Configure Instance Details' to continue
  change 'Configure Instance Details' or used as default settings
@dteoh
dteoh / rspec_rails_set_session.md
Created May 29, 2020 07:49
Setting session variables in an RSpec Rails request spec

Setting session variables in an RSpec Rails request spec

You are writing a spec with type: :request, i.e. an integration spec instead of a controller spec. Integration specs are wrappers around Rails' ActionDispatch::IntegrationTest class. I usually write controller tests using this instead of type: :controller, mainly because it exercises more of the request and response handling stack. So instead of writing something like get :index to start the request, you would write get books_path or similar.

One of the issues with using type: :request is that you lose the ability to

@rabeeaali
rabeeaali / convert.js
Last active May 8, 2023 15:10
Create simple JS function to convert Arabic numbers to English one in input.
// JS code
function toEnglishNumber(strNum) {
var ar = '٠١٢٣٤٥٦٧٨٩'.split('');
var en = '0123456789'.split('');
strNum = strNum.replace(/[٠١٢٣٤٥٦٧٨٩]/g, x => en[ar.indexOf(x)]);
strNum = strNum.replace(/[^\d]/g, '');
return strNum;
}
$(document).on('keyup', '.arabicNumbers', function(e) {
@svinkle
svinkle / a11y-react-live-coding-notes-links.md
Created October 17, 2018 13:26
Creating accessible React apps — a11yTOConf 2018 — Notes and Links
@thbar
thbar / _readme.md
Last active March 27, 2020 19:42
Using minitest to regression test your Jekyll static site

Using minitest to regression-test your Jekyll static site

I recently had to upgrade my blog, which involved changes such as:

  • Replacing a sitemap plugin
  • Upgrading from jekyll 2.5.3 to 3.8.4
  • Upgrading from jekyll-assets 0.7.8 to 3.0.11
  • (etc)

The upgrading process was not trivial, and some parts (e.g. RSS, sitemap, or twitter cards tags) are not immediately visible, so I decided to add unit tests on the generated content.

@jathak
jathak / csv_to_prolog.py
Last active November 27, 2018 10:48
Converts a CSV of availabilities into Prolog code that can make assignments
# csv_to_prolog.py
#
# Takes a CSV from stdin in the following format:
# <Any>, Time1, Time2, Time3, Time4...
# counts, 2, 3, 4, 5... (number of spots for each time)
# Person1, Yes, Maybe, Yes, No... (Yes, Maybe, or No for availability)
# Person2, Yes, Maybe, Yes, No...
#
# and outputs Prolog to do assignments.
#
@imorrish
imorrish / StreamDeckAtem.ps1
Last active July 21, 2020 15:33
Use Elgato Streamdeck to control Blackmagic Design ATEM
#
# ATEM Legato Stream Deck controler
#
# By Ian Morrish
# https://ianmorrish.wordpress.com
#
# Disable display and sleep mode timeouts
function DisableSleepTimeout {
Write-Host "Disabling display and sleep mode timeouts..."
@ckundo
ckundo / accessibility-bug-reporting.md
Last active December 9, 2017 00:42
How to: Accessibility Bug Reports

How to: Accessibility Bug Reports

Here's a run-down of steps I've used to capture and report accessibility bugs in software.

Environment

If you're using MacOS, I recommend setting up VMWare Fusion, even if you have separate Windows hardware. It's much easier to switch between environments for quick screen reader debugging with a local VM.

On MacOS

@bbonamin
bbonamin / Brewfile
Last active March 19, 2024 14:54
Capybara Selenium Webdriver: Headless Chrome (with file downloads!) & Headless Firefox
tap "caskroom/cask"
cask "google-chrome"
cask "firefox"
brew "chromedriver"
brew "geckodriver"