Skip to content

Commit c825aea

Browse files
committed
whoa lots of updates
1 parent 1ada296 commit c825aea

10 files changed

+184
-1
lines changed

Diff for: cli/see-if-server-running-anywhere.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ lsof -t -i :4000
2525
Lol, I can make a one-liner:
2626

2727
```
28-
alias jekyll_server="lsof -t -i :4000 | xargs kill & bundle exec jekyll serve --drafts --incremental"
28+
alias jekyll_server="lsof -t -i :4000 | xargs kill && bundle exec jekyll serve --drafts --incremental"
2929
```
3030

3131
Well, that was easy.

Diff for: cli/xargs-for-multiple-commands.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# `xargs` for multiple commands
2+
3+
You can use `xargs` in many useful ways.
4+
5+
Install `tldr`, run `tldr xargs`.
6+
7+
Here's how I use it:
8+
9+
```
10+
git diff <commit> --name-only | xargs atom
11+
```
12+
13+
Or in aliases:
14+
```
15+
alias jekyll_server="lsof -t -i :4000 | xargs kill && bundle exec jekyll serve --drafts --incremental"
16+
alias run_all_ruby_tests="find ./test -name '*_test.rb' | xargs -n1 ruby"
17+
```
18+
19+
It grabs the output of the prior commands, and passes it in specific ways to whatever comes after `xargs`, like `kill`, or `ruby`, etc.

Diff for: finance-and-taxes/how-to-fill-out-w9.md

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Er, I hope?
1818
- ID Number: `20201737049`
1919
- Formation note: `08/25/2020`
2020

21+
22+
2123
## Where to send payouts
2224

2325
I donno what to do here:

Diff for: git/view-differences-between-adjacent-commits.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# How To View Differences Between Adjacent Commits
2+
3+
4+
```
5+
git diff HEAD~1
6+
git diff HEAD..HEAD~1
7+
8+
```

Diff for: house/insulate-garage.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# How to Insulate an Uninsulated Garage
2+
3+
Make sure caveties that you're adding insulation to are deep enough for the insulation.
4+
5+
If they're not, add narrow strips to get necessary depth (R-20 requires 5.5" of depth, and I live in Colorado, so we're going with R-20)
6+
7+
Add plastic for vapor barrier
8+
9+
10+
11+
## Resources
12+
13+
- [Why Structural Engineers are Awesome](https://www.youtube.com/watch?v=WpOHOGpchAk&list=TLPQMTIwMjIwMjFRd30Su7QVlw&index=2)

Diff for: house/soundproofing-spaces.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# How to Soundproof a Room
2+
3+
I don't know that I'll ever get "soundproofed", but we live in an old house with _horrific_ noise propogation.
4+
5+
Keep in mind:
6+
7+
- Green glue (1 tube per sheet of drywall)
8+
- Vynil mass (1/4" on floor, 1/8" on walls)
9+
- Double sheets of drywall (2 layers 5/8th drywall with green glue between)
10+
- Air gaps
11+
- Insulate foam around all outlet/switch boxes
12+
- avoid air vents if possible
13+
14+
## Doors
15+
16+
Remove door casing, all-the way around: [https://youtu.be/xXHeIOEOiAA?t=1122](https://youtu.be/xXHeIOEOiAA?t=1122)
17+
18+
Fill gap between drywall and door frame with expansion foam.
19+
20+
Solid-core door.
21+
22+
Add a door-stop system with a "active sweep" device that seals along floor when door is closed.
23+
24+
25+
## Windows
26+
27+
## Walls/Ceilings
28+
29+
Drywall: 2 sheets of 5/8" drywall with glue between, staggered edges
30+
31+
between subfloor and drywall: GreenGlue Sealent
32+
33+
Between Drywall and Drywall: Greenglue soundproofing
34+
35+
### Gear-drive Panel Lift
36+
37+
Makes moving/installing sheets of drywall (especially the heavy drywall) easy and safe.
38+
39+
# Resources
40+
41+
## Purchases
42+
43+
- [https://www.tmsoundproofing.com/](https://www.tmsoundproofing.com/)
44+
45+
`HRVDIY` -> 10% off, maybe active, at least in 2019.
46+
47+
## HomeRenoVision DIY
48+
49+
This guy is great:
50+
51+
- [How to Soundproof a Room (youtube)](https://www.youtube.com/watch?v=xXHeIOEOiAA)
52+
53+

Diff for: jekyll/how-to-publish-pages-in-future.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# How To Publish Pages/Posts In The Future
2+
3+
Run a job that rebuilds site every day, per:
4+
5+
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">🌃 Want to schedule Jekyll posts in the future and have them automatically publish later?<br><br>Hook up a GitHub Action to ping your Netlify build hook to rebuild your site once a day: <a href="https://t.co/Yg5CHuULTD">https://t.co/Yg5CHuULTD</a> <a href="https://t.co/fIQB0nFjCa">pic.twitter.com/fIQB0nFjCa</a></p>&mdash; matt swanson 🤔 🦢 (@_swanson) <a href="https://twitter.com/_swanson/status/1360057747795021828?ref_src=twsrc%5Etfw">February 12, 2021</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
6+
7+
[How to Trigger Github Pages Build](https://stackoverflow.com/questions/24098792/how-to-force-github-pages-build/61706020#61706020)

Diff for: rspec/specify-same-as-it-expect.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# `specify` is the same as `it/do/expect`
2+
3+
```ruby
4+
specify { expect(described_class[key]).to eq('val') }
5+
6+
# same as
7+
8+
it "should equal 'val'" do
9+
expect(described_class[key]).to eq('val')
10+
end
11+
```
12+

Diff for: ruby/parameterize-strings-with-active-support.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Parameterize Strings
2+
3+
First, the [String#parameterize](https://www.rubydoc.info/gems/activesupport/5.0.0.1/String:parameterize) method is an ActiveSupport method. It's not available by default to Ruby.
4+
5+
I tried:
6+
7+
```ruby
8+
require 'active_support'
9+
```
10+
11+
and `parameterize` was still unavailable. I found [trying to require active_support in gem](https://stackoverflow.com/questions/18732338/trying-to-require-active-support-in-gem), and the [top answer](https://stackoverflow.com/a/18734988/3210178) said:
12+
13+
> You need to `require` the methods you need from `ActiveSupport`; they aren't added by default.
14+
>
15+
> Like Yevgeniy mentions in a comment, the way to do this is `require "active_support/all"` if you need everything - or if you for example want only the Hash extensions use `require 'active_support/core_ext/hash'`
16+
17+
So, cool! I added:
18+
19+
```ruby
20+
require 'active_support/core_ext/string/inflections'
21+
```
22+
23+
And it was working!
24+
25+
Next, the _default_ parameterize separator is `-`, but a symbol cannot have dashes, it must be underscored:
26+
27+
```ruby
28+
:josh_thompson # valid
29+
:josh-thompson # invalid
30+
```
31+
32+
If I tried to symbolify the bottom option, I'd get `:"josh-thompson"`, which is bad.
33+
34+
So, want to make strings valid symbols, universally?
35+
36+
```ruby
37+
"SUPER strange String".downcase.parameterize(separator: '_').to_sym
38+
=> :super_strange_string
39+
```
40+
41+
Good to go.

Diff for: ruby/uri-tips-tricks.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Class: `URI` tips/tricks
2+
3+
require 'uri' and use it on strings:
4+
5+
```ruby
6+
> url = URI.parse("example.com")
7+
=> #<URI::Generic example.com>
8+
9+
full_url = URI.parse("https://josh.works")
10+
=> #<URI::HTTPS https://josh.works>
11+
12+
insecure_url = URI.parse("http://josh.works")
13+
=> #<URI::HTTP http://josh.works>
14+
```
15+
16+
OK, so to ensure I've got something at the end:
17+
18+
```ruby
19+
def process_url(url)
20+
url = URI.parse(url.strip)
21+
case url
22+
when URI::Generic
23+
# add https:// if doesn't start with it?
24+
"https://" + url.to_s
25+
end
26+
url
27+
end
28+
```

0 commit comments

Comments
 (0)