Skip to content

Instantly share code, notes, and snippets.

View rorhug's full-sized avatar
📀
out on dvd

Rory Hughes rorhug

📀
out on dvd
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <xmmintrin.h>
#define SIZE 600
float rgb_sum_product(float * pixels) {
float sum_red = 0.0, sum_green = 0.0, sum_blue = 0.0;
for (int i = 0; i < SIZE - 3; i += 3) {
sum_red = sum_red + pixels[i];
#!/bin/bash
# Script: my-pi-temp.sh
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# -------------------------------------------------------
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))'C"
@rorhug
rorhug / recase-hasura.mjs
Created February 17, 2021 13:55
Hasura - Change casing of build in fields and columns to camel case
// Run this to set the graphql exposed name for columns and built-in hasura graphql action to
// Afterwards run metadata export as the metadata set into the server does not write back out through docker to local file system
// `npx hasura --project ../hasura metadata export`
import { getIntrospectionQuery } from 'graphql'
import http from 'http'
import url from 'url'
import fs from 'fs'
import dotenv from 'dotenv'
import fetch from 'node-fetch'
@rorhug
rorhug / .zshrc
Last active September 15, 2025 12:32
Use the right js package manager
p() {
if [[ -f bun.lockb ]]; then
echo "Using bun"
command bun "$@"
elif [[ -f pnpm-lock.yaml ]]; then
echo "Using pnpm"
command pnpm "$@"
elif [[ -f yarn.lock ]]; then
echo "Using yarn"
command yarn "$@"