Skip to content

Commit

Permalink
youtube and gist shortcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
halkeye committed Mar 2, 2024
1 parent dd6cc6b commit f993584
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 18 deletions.
6 changes: 3 additions & 3 deletions content/posts/2012-03-14-output-pretty-json-puppet/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ $config_data = { "foo" => "bar" }

I found config_data.to_json wasn't going to work for me because it seemed to output things in different orders each run.

(it was https://snippets.aktagon.com/snippets/412-How-to-pretty-print-JSON-data-with-Ruby that helped me figure this out)
(it was [https://snippets.aktagon.com/snippets/412-How-to-pretty-print-JSON-data-with-Ruby](https://snippets.aktagon.com/snippets/412-How-to-pretty-print-JSON-data-with-Ruby) that helped me figure this out)

**Edit:** While pretty, still doesn't sort so puppet can update the config file each run :( I will figure this out.
</s>

**Edit:** After much trial and error, I ended writing my own library. https://gist.github.com/2287885
**Edit:** After much trial and error, I ended writing my own library. [https://gist.github.com/2287885](https://gist.github.com/2287885)

<Gist gistLink="halkeye/2287885" />
{% gist "halkeye/2287885" %}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ permalink: /2012/07/16/change-mateterminal-xfce4terminal/index.html

Mostly for my own purposes

`mateconftool-2 --set /desktop/mate/applications/terminal/exec --type string "xfce4-terminal"`
```sh
mateconftool-2 \
--set /desktop/mate/applications/terminal/exec \
--type string \
"xfce4-terminal"
```

I'm not a big fan of mate terminal, seems to hurt my eyes, like xfce better, so this still makes the "launch terminal" shortcut work, but launch a different terminal.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Original post:

I decided a while ago to put pull all the plugin source codes for this wordpress install directly from subversion. This makes it easier when files need manual patching or more likely, a file gets deleted.

* https://plugins.svn.wordpress.org/ is the svn root for all the wordpress plugins.
* https://themes.svn.wordpress.org/ is the svn root for all the themes
* [https://plugins.svn.wordpress.org/](https://plugins.svn.wordpress.org/) is the svn root for all the wordpress plugins.
* [https://themes.svn.wordpress.org/](https://themes.svn.wordpress.org/) is the svn root for all the themes

So I created this little helper script that I can use to do a mass update when I get too out of date.

<Gist gistLink="halkeye/6288018" />
{% gist "halkeye/6288018" %}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ I rename a lot of files. Often by hand as it's just easier. I've tried various c

Just So I have reference on what does work:

```bash
find -type f | \
while read file; do \
echo mv \"$file\" \"$(echo $file | sed -e 's/^Old Content/New Content/')\";
done | sh
```
find -type f | while read file; do echo mv \"$file\" \"$(echo $file | sed -e 's/^Old Content/New Content/')\"; done | sh
```


Yea I could probably drop the echo mv, and the |sh, but it feels safer to do a dry run

**2023 Update**: the [rename package](https://packages.debian.org/bookworm/rename) (actually the perl module File::Rename cli) makes this way easier, use rename tool don't use the ugly find above.
4 changes: 2 additions & 2 deletions content/posts/2013-12-31-yaoirpg/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ datetime: 2013-12-31T16:51:59+0800
permalink: /2013/12/31/yaoirpg/index.html
---

tl;dr - https://yaoirpg.halkeye.net is now live again
tl;dr - [https://yaoirpg.halkeye.net](https://yaoirpg.halkeye.net) is now live again

**Y**et **A**nother **O**nline **I**nteraction **R**ole **P**laying **G**ame was a project a group of us at BCIT put together. It was for some of internet studies course (Yea I'm that old / It hadn't been updated yet). Evan, the guy who named it, was also someone who spent a lot of time online and really enjoyed the idea of an acronym that people probably wouldn't get.

Expand All @@ -23,4 +23,4 @@ Anyways, it came up in conversation recently, mostly because I still tell the st

I realized the code wasn't backed up, so I dug through some of my old hard drives, found the code and an old DB dump and this morning through a lot of trial and error (And actually minimal work) got it running in a recent version of php and mysql.

https://yaoirpg.halkeye.net now lives on heroku where it should forever run. Backed up to bitbucket 'cause I'm pretty ashamed of the code :D
[https://yaoirpg.halkeye.net](https://yaoirpg.halkeye.net) now lives on heroku where it should forever run. Backed up to bitbucket 'cause I'm pretty ashamed of the code :D
2 changes: 1 addition & 1 deletion content/posts/2015-01-26-gming/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permalink: /2015/01/26/gming/index.html

How far back does one go when telling a story? I've loved savage worlds since I played it at [Gottacon](https://web.archive.org/web/20150202004332/http://www.gottacon.com:80/?) 2 years ago. I loved how simple it was. How it made the focus having the adventure instead of doing the math. Since then, I've run a handful of games. I loved [Daring tales from the Sprawl](https://web.archive.org/web/20140828124209/http://rpg.drivethrustuff.com:80/product/65369/DTotSprawl-01-Family-Affair--Extraction-101). It was very easy to run with the experience of DMing I had. Then came along the [Science Fiction Companion](https://web.archive.org/web/20150113175318/http://rpg.drivethrustuff.com:80/product/125438/Savage-Worlds-Science-Fiction-Companion) and the [Last Parsec Kickstarter](https://web.archive.org/web/20150403125738/https://www.kickstarter.com/projects/545820095/the-last-parsec-savage-worlds). At this point I was really really excited about running more savage worlds, but I kept putting things off.

Well, the last two pieces of the had to be the anxiety based breakdown I had last year (And shout outs to the people I was about to talk too) and the subsequent doctors visits and medication. The last and final part was reading about the last parsec adventures at https://ilive4crits.blogspot.ca/
Well, the last two pieces of the had to be the anxiety based breakdown I had last year (And shout outs to the people I was about to talk too) and the subsequent doctors visits and medication. The last and final part was reading about the last parsec adventures at [https://ilive4crits.blogspot.ca/](https://ilive4crits.blogspot.ca/)

After all that, I decided as a way of learning to deal with my anxiety again, I'm going to stop putting things off and start GMing again. No campaigns, at least not yet, just something fun and light weight. To ease back into it, I gathered a group of people for a simple instance of of [School Daze](https://web.archive.org/web/20150805064859/http://www.sandandsteam.net/schooldaze-2/) since I had not even played anything in a year, and not run anything in an even longer time.

Expand Down
2 changes: 1 addition & 1 deletion content/posts/2016-01-06-cat-2/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permalink: /2016/01/06/cat-2/index.html

I've been slowly trying out a couple random cat toys for the cat. So far mine has been mostly meh about them. These [cat springs](https://www.amazon.ca/gp/product/B000CMKHDG?) were highly recommended on amazon, so decided to check them out. The idea of cat playing with springs is very weird, but why not right?

`youtube:https://www.youtube.com/embed/fYx_BgoMtKY`
{% youtube "fYx_BgoMtKY" %}

Okay, I think that might have been a huge success.

Expand Down
2 changes: 1 addition & 1 deletion content/posts/2016-05-13-talk-on-testing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ One of my personal goals for this year is to start getting more comfortable shar

This is my second [Code and Coffee](https://web.archive.org/web/20160504031434/http://www.meetup.com:80/Code-Coffee-Vancouver/?) talk ever, and I can see I'm still pretty nervious giving the talk, but I think other than a few technical glitches (which were thankfully edited out) it went really well.

`youtube:https://www.youtube.com/embed/iPGSJVASCkc`
{% youtube "iPGSJVASCkc" %}

I have so much fun doing them. I love the fact that people come up to you afterwards and walk to talk about topics.

Expand Down
4 changes: 2 additions & 2 deletions content/posts/2016-05-14-my-gopro-experiments/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ About a month ago now, I picked up this really cheap accessory pack off amazon.

Yesterday on my bike ride to work, I decided it might be fun try out the chest harness. I put it on. Checked that it all worked. Everything seemed to work just fine. I didn't really think about how on a bike you are at least slightly bent over. The results? 45 min of looking at my handle bars. Its kinda fun to try to figure out where I am from the various peices you can see.

`youtube:https://www.youtube.com/embed/UMiFnC1yzmQ`
{% youtube "UMiFnC1yzmQ" %}

My next favourite experiment would be the suction cup mount. I stuck it to my outer window, and let it run for a little bit. Then timelapsed/sped up the 20 minute video down to 15 seconds.

`youtube:https://www.youtube.com/embed/GL6vuF4aaRU`
{% youtube "GL6vuF4aaRU" %}

I think it turned out pretty cool
12 changes: 11 additions & 1 deletion eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(pluginNavigation);
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);

// Shortcodes

eleventyConfig.addShortcode("gist", (id) => `<div>Gist: <a href="https://gist.github.com/${id}" title="Github Gist ${id}">${id}</a></div><script src="https://gist.github.com/${id}.js"></script>`);
eleventyConfig.addShortcode("youtube", (id) => `<iframe width="560" height="315"
src="https://www.youtube-nocookie.com/embed/${id}"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>`);

// Filters
eleventyConfig.addFilter("readableDate", (dateObj, format, zone) => {
// Formatting tokens for Luxon: https://moment.github.io/luxon/#/formatting?id=table-of-tokens
Expand Down Expand Up @@ -130,7 +140,7 @@ module.exports = function (eleventyConfig) {
],

// Pre-process *.md files with: (default: `liquid`)
markdownTemplateEngine: false,
// markdownTemplateEngine: false,

// Pre-process *.html files with: (default: `liquid`)
htmlTemplateEngine: "njk",
Expand Down

0 comments on commit f993584

Please sign in to comment.