Skip to content

Instantly share code, notes, and snippets.

View BodieLeonard's full-sized avatar

Bodie Leonard BodieLeonard

  • Freelance
  • Dallas Tx
View GitHub Profile
@Haroenv
Haroenv / head.html
Last active November 22, 2024 16:39
html head
<html lang="en">
<head>
<title> Title of the Page </title>
<meta charset="utf-8" />
<!-- saying that the browser doesn't need to rescale on mobile -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<!-- status bar in transparent/colour -->
@glen-cheney
glen-cheney / encoding-video.md
Last active December 12, 2025 23:58
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@DiegoSalazar
DiegoSalazar / validate_credit_card.js
Last active January 22, 2026 15:26
Luhn algorithm in Javascript. Check valid credit card numbers
// Takes a credit card string value and returns true on valid number
function valid_credit_card(value) {
// Accept only digits, dashes or spaces
if (/[^0-9-\s]+/.test(value)) return false;
// The Luhn Algorithm. It's so pretty.
let nCheck = 0, bEven = false;
value = value.replace(/\D/g, "");
for (var n = value.length - 1; n >= 0; n--) {
@codler
codler / gist:3906826
Created October 17, 2012 17:18
Support HTTP Header Range, mp4, php.php/mp4.mp4
<?php
# Nginx don't have PATH_INFO
if (!isset($_SERVER['PATH_INFO'])) {
$_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"]));
}
$request = substr($_SERVER['PATH_INFO'], 1);
$file = $request;
$fp = @fopen($file, 'rb');