Skip to content

Instantly share code, notes, and snippets.

View joe-sharp's full-sized avatar
🧙‍♂️
10.846.000

Joe Sharp joe-sharp

🧙‍♂️
10.846.000
View GitHub Profile
@aks
aks / git-copy
Created June 29, 2021 04:00
Bash script to copy a file in a git repo with history preservation
#!/usr/bin/env bash
# git-copy [options] SOURCEFILE NEWFILE
usage() {
cat 1>&2 <<USAGE
usage: git-copy [options] SOURCEFILE NEWFILE
Copies a SOURCEFILE within a git repo to a NEWFILE in a way
that preserves the change history so that changes in SOURCEFILE
are still viewable in NEWFILE.
@joe-sharp
joe-sharp / easter_egg.js
Last active September 8, 2021 03:45
Easter Egg on Personal Website
const keyboard_pic = document.querySelector('div#home-card img')
const keyCode = "ASDFU"
let keyStack = ""
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function rgbKeyboard() {
keyboard_pic.src = "images/keyboard-lit.jpg"
@joe-sharp
joe-sharp / memento.rb
Last active November 26, 2020 18:19
Memento Design Pattern in Ruby
class Memento
attr_accessor :state
def initialize(state)
@state = state
end
end
class Caretaker
attr_reader :memento
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active July 29, 2024 04:16
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux