Skip to content

Instantly share code, notes, and snippets.

View Moosemorals's full-sized avatar

Osric Wilkinson Moosemorals

View GitHub Profile
@peterhellberg
peterhellberg / graceful.go
Last active November 13, 2024 20:20
*http.Server in Go 1.8 supports graceful shutdown. This is a small example.
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
@virtualdreams
virtualdreams / mono-server4.service
Created May 5, 2015 06:02
systemd mono-server4 unit script
[Unit]
Description=FastCGI mono server 4
After=network.target
[Service]
Environment=MONO_IOMAP=all
EnvironmentFile=
Type=simple
ExecStart=/usr/bin/fastcgi-mono-server4 /applications=*:/:/srv/www/mvc/ /socket=tcp:127.0.0.1:9000
User=www-data
@GrahamCobb
GrahamCobb / Humax HMT format
Last active December 15, 2023 07:35
Humax HDR Recorders file formats
Offset Size Content
------ ----- ---------------------------------- Header Block, Size 0x1004 (4100) bytes ---------------------------------------------
0x0000 2 byte 0x1701 Constant.
0x0000 126 byte All Nulls.Constant
------ ----- ---------------------------------- This next part is rewritten when playback completes/pauses
It seems to contain information about the recording
0x0080 string 254 byte max Recording file path e.g. "/media/sda1/My Video/" (not needed when creating hmt)
0x017F string 256 byte max Recording date-extended file name e.g. "The One Show_21010816_1817"
0x0280 4 byte 0x11223344 Recording start time (Epoch format)
0x0284 4 byte 0x11223344 Recording end time (Epoch format)
@lemiorhan
lemiorhan / post-receive
Last active February 8, 2023 10:06
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then
@don1138
don1138 / font-stacks.css
Last active May 14, 2024 13:16
CSS Modern Font Stacks
/* Modern Font Stacks */
/* System */
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
/* System (Bootstrap 5.2.0) */
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* Times New Roman-based serif */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;