Skip to content

Commit 08fd563

Browse files
andrewbolsterclaude
andcommitted
Replace jekyll-gist embeds with inline code blocks
Fix Ruby 3.4 compatibility issue where jekyll-gist 1.5.0 fails with "uninitialized constant Jekyll::Gist::GistTag::TimeoutError". Replaced gist embeds in three old posts with inline code blocks containing the original gist content. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 5f17924 commit 08fd563

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

_posts/2013-12-20-installing-ubuntu-touch-on-the-nexus-7.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ So without further ado, the assumption: If you're thinking of putting Ubuntu on
3333

3434
Once that's all wrapped up, onto the meat.
3535

36-
{% gist 8057017 %}
36+
```bash
37+
sudo add-apt-repository ppa:phablet-team/tools
38+
sudo apt-get update
39+
sudo aptitude -y install phablet-tools android-tools-adb android-tools-fastboot
40+
phablet-flash ubuntu-system --channel devel --bootstrap
41+
```
3742

3843
Job done! Hopefully Cyanogenmod can take some inspiration for this.

_posts/2014-01-20-unicode-madness-in-jekyll.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,21 @@ So a file with no contents and a completly different title was still screwing th
3030

3131
So what's the difference between it and any other file?
3232

33-
{% gist 8520058 %}
33+
```bash
34+
➜ _posts git:(master) ✗ file 2014-01-20-schreibdochmal_19_01_14.md
35+
2014-01-20-schreibdochmal_19_01_14.md: exported SGML document, UTF-8 Unicode (with BOM) text, with very long lines
36+
➜ _posts git:(master) ✗ file 2014-01-11-the-making-of-a-timelapse.md
37+
2014-01-11-the-making-of-a-timelapse.md: ASCII text, with very long lines
38+
```
3439

3540
Wut?...
3641

3742
Funnily enough this is hinted as a problem in [this stack overflow post](http://stackoverflow.com/questions/12467632/jekyll-regeneration-failed-with-unicode-posts) but doesn't propose a solution. (Although `chcp 650001` didn't work for me), but it mentioned the [BOM](http://en.wikipedia.org/wiki/Byte_order_mark), or Byte Order Mark, an invisible endiness indicator that sits at the front of a text stream waiting to spoil your day.
3843

3944
Long story short, can be fixed by [this answer](http://stackoverflow.com/questions/1068650/using-awk-to-remove-the-byte-order-mark)
4045

41-
{% gist 8520118 %}
46+
```bash
47+
awk '{if(NR==1)sub(/^\xef\xbb\xbf/,"");print}' INFILE > OUTFILE
48+
```
4249

4350
Hopefully this helps someone along later on.

_posts/2014-04-09-generating-a-unit-3-vector-in-python-uniform-spherical-projection.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,27 @@ As part of my PhD work I'm building different behaviours for virtual submarines.
2222

2323
So to make things easier, I stole [this StackOverflow answer from dmckee](http://stackoverflow.com/a/5408843/252556) and tidied it up a bit for my purposes. (Assuming everyone else is like me and does `import numpy as np`)
2424

25-
{% gist 10274979 %}
25+
```python
26+
def random_three_vector():
27+
"""
28+
Generates a random 3D unit vector (direction) with a uniform spherical distribution
29+
Algo from http://stackoverflow.com/questions/5408276/python-uniform-spherical-distribution
30+
:return:
31+
"""
32+
phi = np.random.uniform(0,np.pi*2)
33+
costheta = np.random.uniform(-1,1)
34+
35+
theta = np.arccos( costheta )
36+
x = np.sin( theta) * np.cos( phi )
37+
y = np.sin( theta) * np.sin( phi )
38+
z = np.cos( theta )
39+
return (x,y,z)
40+
41+
# Example IPython code to test the uniformity of the distribution
42+
from pylab import scatter
43+
threetups = []
44+
for _ in xrange(1000):
45+
threetups.append(random_three_vector())
46+
zipped = zip(*threetups)
47+
scatter(*zipped[0:2])
48+
```

0 commit comments

Comments
 (0)