Wessell's site logo Wessell's ☺️site

Tech Demo ☺️🧑‍💻

2024-05-08, 02:00 (UTC +08:00)
Cover picture showing Cheung Chau Cover picture showing Cheung Chau

This is just a little playground to test if I can get what I want to use for my blog working.

Twemoji 🗨🐦

I’ve set up Twemoji injection a long while ago, but here it is:


PS: I’ve also set up remark-emoji to make typing emoji less of a pain. :people_hugging: doesn’t work right now and I’ll look into it when I’m free.

LaTeX ☝️🤓

Here’s the (in)famous Euler’s formula written using remark-math and rehype-katex.

ejπ=cos⁡x+jsin⁡xe^{j\pi} = \cos x + j \sin x

Syntax Highlighting 🖊️ & Image support 🖼️ (It’s there but I wanted to add some CSS)

Here’s a code snippet I wrote for my assignment for EIE3331:

  #!/usr/bin/env python3

  from numpy import pi, cos, linspace
  import matplotlib.pyplot as p

  ABCD = 5227 # last four digits of student ID to be sent

  t = linspace(start=0, stop=10**-4, num=10**4) # time range = [0, 10^-4]

  f_c = 10**6 # carrier frequency 10^6 Hz

  v_ct = 1000 * cos(2 * pi * f_c * t) # carrier signal v_c(t)

  f_m = 10**4 # message frequency 10^4 Hz
  mt = ABCD/1000 * cos(2 * pi * f_m * t) # message signal m(t)

  v_at = mt * v_ct # DSB-SC signal v_a(t)

  p.plot(t, v_at, color='k', linewidth=.5, clip_on=False)

  p.ticklabel_format(style='scientific', axis='both', scilimits=(0,0), useMathText=True) # make the tick labels look less ugly
  p.grid(visible=True, alpha=.5)

  p.title('Waveform of DSB-SC signal $v_a(t)$ for $abcd = 5227$')
  p.ylabel('Amplitude Level')

  p.savefig('q1.eps', bbox_inches='tight')

A DSB-SC Waveform

Weather Cards 🏙️🌦️

I wrote some code to fetch weather data from the Hong Kong Observatory a while ago dynamically. Since this website ships no JavaScript to the client, it’s only rendered on the server and not updated client-side. Just keep that in mind.

It’s quite a bit ugly right now, but it does work. I might come back and touch up on the CSS later.

Removed for the time being.

Turns out it’s broken right now due to my sloppy spaghetti architecture. To be fixed Soon ☺️ .

Jyutping 🇭🇰🗣️

Some Jyutping injection! No JavaScript needed! Powered by @CanCLID/to-jyutping.

睇tai2得dak1明ming4嘅ge3話waa2,同tung4我ngo5講gong2 「☺️‼️」啦la1!


Note that the result is not perfect. For example, 與 was rendered as jyu5, but which should have been jyu4 in the literary/archaic sense.