Skip to content

Instantly share code, notes, and snippets.

View ben-nour's full-sized avatar

Ben Nour ben-nour

View GitHub Profile
@ben-nour
ben-nour / pi_zero_wifi_solution.md
Last active November 3, 2024 13:52
Headless Raspberry Pi Zero 2 W not connecting to WiFi - solution

Headless Raspberry Pi Zero 2 W not connecting to WiFi - solution

If you've set up a headless Raspberry Pi Zero 2 W with the Rasberry Pi Imager (and specified the SSID/password) but your Pi is not connecting to the WiFi make sure you are connecting to Wireless 2.4 GHz!

Wireless 5 GHz will not work!

@ben-nour
ben-nour / extract_fy.sql
Last active August 12, 2024 02:25
Snowflake UDF to extract FY from a date.
CREATE OR REPLACE FUNCTION extract_fy(date_to_convert varchar, date_format varchar DEFAULT 'YYYY-MM-DD')
RETURNS VARCHAR
LANGUAGE SQL
AS
$$
SELECT
CASE
WHEN MONTH(TRY_TO_DATE(date_to_convert, date_format)) >= 7 THEN
CONCAT('FY', RIGHT(YEAR(TRY_TO_DATE(date_to_convert, date_format)) + 1, 2))
ELSE CONCAT('FY', RIGHT(YEAR(TRY_TO_DATE(date_to_convert, date_format)), 2))