Skip to content

Instantly share code, notes, and snippets.

View alanwflood's full-sized avatar

Alan alanwflood

  • Dublin, Ireland
View GitHub Profile
@alanwflood
alanwflood / input.scss
Created February 2, 2021 09:21
Generated by SassMeister.com.
// Updated: 28th Jan 2021 with James
:root {
--gp-primary-lighten1: #f6f7f8;
--gp-primary-lighten2: #edeef2;
--gp-primary-lighten3: #ced8e0;
--gp-primary-lighten4: #aebecb;
--gp-primary-base: #8ea3b4;
--gp-primary-darken1: #7691a5;
--gp-primary-darken2: #5c7e95;
--gp-primary-darken3: #55758d;
@alanwflood
alanwflood / eslint-typescript.md
Last active February 6, 2021 17:17 — forked from pedrouid/eslint-typescript.md
Eslint + Prettier configuration for Typescript 3.7+ (2020)

Eslint + Prettier configuration for Typescript 3.7+ (2020)

  1. Install required dependencies
npm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-config-standard eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise prettier
  1. Setup your .eslintrc config file
{
@alanwflood
alanwflood / Rails Naming Cheatsheet.txt
Last active July 27, 2019 16:04
Rails Naming Conventions Cheatsheet
Controller Plural rails g controller Users index show
Helper Plural rails g helper Users
Mailer Singular rails g mailer UserMailer
Migration Plural rails g migration AddEmailToUsers email:string
Model Singular rails g model User name:string
Observer Singular rails g observer User
Resource Plural* resources :users, :only => [:index, :show]
Scaffold Singular rails g scaffold User name:string
Table Plural SELECT * FROM users;
View N/A app/views/users/index.html.erb – comprised of controller (plural) and action (singular)
@alanwflood
alanwflood / SexyCss.css
Created August 30, 2017 19:31
Sexy CSS
// Some of the fancier CSS things I've come across
// Fancy af box-shadow
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.50);
@alanwflood
alanwflood / til.js
Last active August 30, 2017 19:38
TIL Javascript
As I'm constantly learning about JS, here's some helpful stuff I've found
// Jquery's $(document).ready() function in vanilla js
document.addEventListener("DOMContentLoaded", function() {
// a longer way to wait for the DOM to load, without jQuery.
// jQuery's syntax is much shorter!
});
// Use Object.defineProperties to
// add multiple getters and setters in a constructor
rsync -av --log-file=/mnt/NAS/rsync.log /mnt/NAS /mnt/HomeNAS
@alanwflood
alanwflood / Timezones.txt
Last active September 1, 2017 10:14
Rails Timezones Good And Bad Ones
DON’T USE
* Time.now
* Date.today
* Date.today.to_time
* Time.parse("2015-07-04 17:05:37")
* Time.strptime(string, "%Y-%m-%dT%H:%M:%S%z")
DO USE
Example .tern-project file (customize to your own needs):
{
"ecmaVersion": 6,
"libs": [
"browser"
],
"loadEagerly": [
"path/to/your/js/**/*.js"
],
@alanwflood
alanwflood / Spacemacs Cheatsheet
Last active February 15, 2017 17:27
Stuff I've learned about spacemacs that I probably won't remember but don't want to forget ¯\_(ツ)_/¯
spc-t-c : toggle camelcase motions
ctrl-j, ctrl-k : Next/Prev commands in terminal
M-r : Search for past command inside terminal
SPC m c: create a new multi-term
https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Btools/ranger
def currency_codes
currencies = []
Money::Currency.table.values.each do |currency|
currencies = currencies + [[currency[:name] + ' (' + currency[:iso_code] + ')', currency[:iso_code]]]
end
currencies
end