Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ConorSheehan1's full-sized avatar

Conor Sheehan ConorSheehan1

View GitHub Profile
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Conor Sheehan",
"label": "Software Engineer",
"image": "https://s.gravatar.com/avatar/e5177f7635c1a7c51a50de6dc80052fe?s=300&r=g",
"email": "conor.sheehan.dev@gmail.com",
"summary": "I'm a full stack web developer who can build apps from the ground up.",
"website": "https://conorsheehan1.github.io",
"location": {
@ConorSheehan1
ConorSheehan1 / fireworks.scss
Created August 20, 2022 14:13
firework effect with sass, from codepen with updated sass deprecations
// https://codepen.io/hmaw/pen/qBEMLxV
// sass fixes https://sass-lang.com/documentation/breaking-changes/color-units
// https://sass-lang.com/documentation/breaking-changes/slash-div
// // to use, add html like this:
// <div class="fireworks">
// <div class="beforeFireworks" v-if="showGameWonModal" />
// <div class="afterFireworks" v-if="showGameWonModal" />
@use "sass:math";
@ConorSheehan1
ConorSheehan1 / browser_editor.html
Created December 8, 2020 16:06
editor in browser
<!-- paste the following into the address bar -->
data:text/html,<body style="margin:0;font-family: monospace;font-size: large"><div style="margin:0;padding: 1em; height: 100vh" contenteditable>EDIT ME</div></body>
@ConorSheehan1
ConorSheehan1 / naff.js
Last active November 12, 2020 14:27
javascript abuse, self describing code because it is itself naff. A coworker shared the fail example with me so I expanded a bit.
// example: https://jsfiddle.net/conorsheehan1/vqdfsh31/
// runnable in any browser console
// fail (coworker showed me this one)
(![] + [])[+[]] + (![] + [])[+!+[]] + ([![]] + [][[]])[+!+[] + [+[]]] + (![] + [])[!+[] + !+[]];
// Naff
((![] + [][[]]) + [])[+[]] + ((![] + [][[]]) + [])[+!+[]] + (![] + [])[+[]] + (![] + [])[+[]];
// Nooo
@ConorSheehan1
ConorSheehan1 / osx_latest_screenshot.sh
Last active December 5, 2020 00:06
on OSX / macOS manage screenshots from the terminal (list, copy, etc.)
# print the path to the latest screenshot
latest_screenshot() {
# get screenshot dir, replace ~ with $HOME (required for ls to work)
screenshot_dir=$(defaults read com.apple.screencapture location | sed "s;~;$HOME;")
# use ls -t to order by time, use head -n 1 to get only latest
file_name=$(/bin/ls -t $screenshot_dir | head -n 1)
# if REL is passed, show relative path (filename), otherwise show absolute path
if [[ -z "$REL" ]]; then
printf "%q\n" "$screenshot_dir/$file_name"
else
@ConorSheehan1
ConorSheehan1 / find_tools.sh
Last active March 21, 2019 10:32
grep within glob files
# bash, find import in every .py file recursively under the current dir
grep -rin --include="*.py" import
# find files bye name and follow symlinks
find -L ./ -name "*.sublime-snippet"
@ConorSheehan1
ConorSheehan1 / standup.sh
Last active July 7, 2023 14:17
bash script to show git commits for a standup.
# show commits from all branches for current git user.
function my-commits-since() {
git log --all --author=$(git config user.email) --since=$@
}
# show commits from yesterday.
# if none were found, assume it's Monday and show commits from Friday.
function standup() {
if [ -z "$(my-commits-since yesterday)" ]; then
my-commits-since last.friday.midnight $@;

set -x shows all commands in bash as they are run. to stop showing commands, reload the shell e.g. exec $SHELL

set -x && echo "hi"
exec $SHELL

# # output (stdout)
# + echo hi
# hi
@ConorSheehan1
ConorSheehan1 / docker_commands.md
Last active August 27, 2020 13:19
docker commands

Commands

# start container, attach stdin, use psuedo tty, use host network
docker run -it --network=host ubuntu:16.04  

# Delete all containers
docker rm $(docker ps -aq)  

# Delete all images 
@ConorSheehan1
ConorSheehan1 / .rubocop.yml
Last active December 29, 2021 14:07
My personal preference for ruby style
# add indent after access modifier e.g. private
Layout/IndentationConsistency:
EnforcedStyle: indented_internal_methods # previously rails style
# Use double quotes by default, common in large projects including rails
# https://anti-pattern.com/always-use-double-quoted-strings-in-ruby
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes