Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mrbar42
mrbar42 / README.md
Last active April 20, 2024 02:57
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@domenic
domenic / 0-github-actions.md
Last active April 8, 2024 23:35
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@kitek
kitek / gist:1579117
Created January 8, 2012 17:50
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");
@JMPerez
JMPerez / performance-observer-ga.js
Created June 17, 2017 08:24
An example of Performance Observer reporting data to Google Analytics
const observer = new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
// `name` will be either 'first-paint' or 'first-contentful-paint'.
const metricName = entry.name;
const time = Math.round(entry.startTime + entry.duration);
ga('send', 'event', {
eventCategory: 'Performance Metrics',
eventAction: metricName,
eventValue: time,
@roman01la
roman01la / index.html
Created June 17, 2013 01:32
THREE.js scene setup with JSONLoader for OSM2WebGL demo
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="viewport"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r58/three.min.js"></script>
<script src="//threejs.org/examples/js/controls/OrbitControls.js"></script>
@CodingDoug
CodingDoug / README.md
Last active December 14, 2022 09:48
Realtime Database triggers with Cloud Functions for Firebase - source

Realtime Database triggers with Cloud Functions for Firebase - source

This gist contains the source code in my video series about Realtime Database triggers. You can watch the three parts here:

  1. Part 1 (intro, onCreate)
  2. Part 2 (onUpdate, infinite loops)
  3. Part 3 (onDelete, transactions)

index.ts contains the Cloud Functions code, and dialog.ts contains the script to run

@paulirish
paulirish / README.md
Created January 4, 2010 02:38
imagesLoaded() jquery plugin
@westonruter
westonruter / scripts-to-footer-exclude-amp.php
Last active June 2, 2020 06:08
Exclude all AMP scripts from being moved to the footer by the Scripts To Footer plugin. All AMP scripts have async anyway so they do not need to be moved to the footer for performance.
@NickBarreto
NickBarreto / iBooks popups which degrade nicely in other devices
Last active February 2, 2019 16:33
How to create popup footnotes in iBooks which degrade well for other EPUB3 readers
The only requirements for popup footnotes in iBooks are:
* Ebook has to be an EPUB3
* epub:type "noteref" and "footnote"
So you can link to a totally separate document, as you normally would for endnotes,
but include the attributes so the <a> link behaves differently in iBooks, instead triggering the popup.
Original reference link would look something like this (in a file called ch001.html):
<a epub:type="noteref" href="footnote.html#note1">1</a></div>
@adactio
adactio / lettering.html
Created January 26, 2012 11:35
A quick'n'dirty way of doing some lettering.js stuff without jQuery.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test</title>
<style>
.slogan span:nth-child(odd) {
color: red;
}
</style>
</head>