Skip to content

Instantly share code, notes, and snippets.

View seanmodd's full-sized avatar
🏠
Working from home

Sean Modd seanmodd

🏠
Working from home
View GitHub Profile
@cblunt
cblunt / git_basics.md
Last active March 11, 2024 16:00
A simple git cheatsheet for reference.

Quick Summary

cd my_project

git init .
git add . # add everything
git commit -m 'Initial commit'

... make some changes ...

@alexpchin
alexpchin / Add_Existing_Project_To_Git.md
Created June 1, 2014 20:14
Add Existing Project To Git Repo

#Adding an existing project to GitHub using the command line

Simple steps to add existing project to Github.

1. Create a new repository on GitHub.

In Terminal, change the current working directory to your local project.

##2. Initialize the local directory as a Git repository.

git init
@eguven
eguven / brew-list.sh
Last active June 12, 2024 13:30
List all packages installed using Homebrew and their sizes
# this original one uses values returned from 'brew info'
brew list --formula | xargs -n1 -P8 -I {} \
sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \
sort -h -r -k2 - | column -t
# faster alternative using 'du'
du -sch $(brew --cellar)/*/* | sed "s|$(brew --cellar)/\([^/]*\)/.*|\1|" | sort -k1h
@yaoyunchen
yaoyunchen / .aliases
Last active September 28, 2023 16:14
Aliases (~/.aliases)
# Docker
alias d='docker'
alias da='docker attach'
alias dr='docker restart'
alias dimg='docker images'
alias dps='docker ps'
alias dvol='docker volume ls'
alias dclearimg='docker rmi $(docker images --quiet --filter "dangling=true")'
alias dclearps='docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v'
alias dclearvol='docker volume rm $(docker volume ls -qf dangling=true)'
@stolinski
stolinski / providerCompose.js
Created April 23, 2019 17:40
ProviderComposer
function ProviderComposer({ contexts, children }) {
return contexts.reduceRight(
(kids, parent) =>
React.cloneElement(parent, {
children: kids,
}),
children
);
}
@scrapehero
scrapehero / booking.json
Created May 16, 2019 06:23
A quick and easy tutorial to scrape data from Booking.com based on parameters destination, date, budget, star rating, and distance from city center.
{
"_id":"booking",
"startUrl":[
"https://www.booking.com/searchresults.html?aid=1508980&sid=ee7c661a3ec2420db360347075d64079&tmpl=searchresults&checkin_month=6&checkin_monthday=4&checkin_year=2019&checkout_month=6&checkout_monthday=7&checkout_year=2019&city=20015725&class_interval=1&dest_id=20015725&dest_type=city&from_sf=1&group_adults=2&group_children=0&label_click=undef&no_rooms=1&raw_dest_type=city&room1=A%2CA&sb_price_type=total&shw_aparth=1&slp_r_match=0&src=searchresults&srpvid=4f694ca313d60042&ss=San%20Diego&ssb=empty&ssne=San%20Diego&ssne_untouched=San%20Diego&nflt=pri%3D2%3B&rsf="
],
"selectors":[
{
"id":"product listing",
"type":"SelectorElement",
"parentSelectors":[
@mindplay-dk
mindplay-dk / php-upgrades.md
Last active June 11, 2024 10:30
PHP upgrades

Upgrading PHP

Guidelines for upgrading the minimum PHP version requirements of packages and projects.

This isn't meant to be an exhaustive guide to upgrading, but as a checklist for the most important upgrades.

PHP 5.3

The first version to support namespaces - any relevant PHP packages/projects usually have this version as the minimum requirement, so this document won't concern itself with upgrades prior to that.

@kepano
kepano / obsidian-web-clipper.js
Last active June 27, 2024 14:59
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@seanmodd
seanmodd / shortcuts.md
Last active August 12, 2021 21:10
Shortcuts to Remember

Shortcuts to always remember

Shorcut Action Shortcut Action
1. ^⌥G Google Search! --- 2. ⌥⌘K Bookmark Line of Code!
3. ⌥⌘L Jump to Next Bookmark! --- 4. ⌥⌘J Jump to Previous Bookmark!
5. ⌥⌘P Takes a CodeSnap! --- 6. ⌥⌘O Opens settings.json file!
7. ^⌥↑ Fast Move Upwards! --- 8. ^⌥↓ Fast Move Downwards!
9. ⌥⌘C Add CodeTour Step! --- 10. ^⌥↓ Fast Move Downwards!
@seanmodd
seanmodd / main.tour
Created August 7, 2021 19:59
summer2021-codetour
{
"$schema": "https://aka.ms/codetour-schema",
"title": "Legend",
"steps": [
{
"file": "pages/_app.js",
"description": "The loading indicator is here",
"line": 33,
"selection": {
"start": {