Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View simonhlee97's full-sized avatar
🎯
Focusing

Simon simonhlee97

🎯
Focusing
View GitHub Profile
@simonhlee97
simonhlee97 / custom-block-starter.php
Last active January 12, 2024 16:52
WP-custom-block-plugin-starter
<?php
/*
Plugin Name: Awesome Block Block Type
Version: 1.0
Author: Simon
Author URI: https://github.com/simonhlee97
*/
if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@simonhlee97
simonhlee97 / resize_images.sh
Created January 4, 2024 12:32
bash script to resize images
#!/bin/bash
# Set the input and output directories
input_dir="input"
output_dir="output"
# Create the output directory if it doesn't exist
mkdir -p "$output_dir"
# Iterate over each JPG file in the input directory
@simonhlee97
simonhlee97 / lightbox-gallery.html
Created December 28, 2023 02:55
lightbox2 image gallery example
@simonhlee97
simonhlee97 / responsive-img-srcset.html
Last active December 28, 2023 02:03
responsive images using srcset
<img srcset="large.jpg 1024w,
medium.jpg 640w,
small.jpg 320w"
sizes="(min-width: 36em) 33.3vw,
100vw"
src="small.jpg"
alt="A rad wolf"
/>
<!-- common image sizes
@simonhlee97
simonhlee97 / my-DLST-stack.md
Last active August 22, 2023 04:28
I enjoy using the DLST-Stack
@simonhlee97
simonhlee97 / vite.json
Created March 1, 2023 10:21
Make Vite compatible with Rails.
{
"all": {
"sourceCodeDir": "app/frontend",
"watchAdditionalPaths": []
},
"development": {
"autoBuild": true,
"host": "127.0.0.1",
"publicOutputDir": "vite-dev",
"port": 3036
@simonhlee97
simonhlee97 / css-reset.css
Created February 21, 2023 09:59
modern CSS reset
/* credit: https://andy-bell.co.uk/a-modern-css-reset/ */
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
@simonhlee97
simonhlee97 / commongems.rb
Created February 15, 2023 00:57
common gems - basic starter for Rails projects
# better error messages
gem 'better_errors'
# authentication
gem 'devise'
# roles and authorization
gem 'cancancan'
# preview emails in browser
@simonhlee97
simonhlee97 / resume.json
Last active February 8, 2023 02:38
online resume
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Simon Lee",
"label": "Software Developer",
"image": "https://picsum.photos/id/237/200/300",
"website": "https://simonhlee97.github.io/",
"email": "simonhlee4945@gmail.com",
"summary": "I'm a full stack web developer who has experienced a plethora of stacks and tools. From WordPress to MERN stack, Jamstack, Ruby on Rails, and even a little Django - I love to experiment and learn new approaches and ways of building applications. I am always open to learning new tools and flexible when it comes to searching for my next project or job.",
"location": {
@simonhlee97
simonhlee97 / Gemfile
Last active January 23, 2023 03:23
Gemfile (with RSpec and shoulda-matchers)
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.0.2"
gem "bootsnap", require: false
gem "devise"
gem "rails", "~> 7.0.4", ">= 7.0.4.1"
gem "sprockets-rails"
gem "pg", "~> 1.1"