Skip to content

Instantly share code, notes, and snippets.

Dan Gayle dangayle

Block or report user

Report or block dangayle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dangayle
dangayle / README.md
Created Apr 24, 2019 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)
View README.md

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
      |- 360p.m3u8
@dangayle
dangayle / ffmpeg.sh
Created Mar 2, 2019 — forked from crookm/ffmpeg.sh
FFmpeg commands to create DASH and HLS
View ffmpeg.sh
mkdir dash && \
ffmpeg -hide_banner -i original.mkv -c:v libvpx-vp9 -row-mt 1 -keyint_min 150 -g 150 -tile-columns 4 -frame-parallel 1 \
-movflags faststart -f webm -dash 1 -speed 3 -threads 4 -an -vf scale=426:240 -b:v 400k -r 30 -dash 1 dash/426x240-30-400k.webm && \
ffmpeg -hide_banner -i original.mkv -c:v libvpx-vp9 -row-mt 1 -keyint_min 150 -g 150 -tile-columns 4 -frame-parallel 1 \
-movflags faststart -f webm -dash 1 -speed 3 -threads 4 -an -vf scale=426:240 -b:v 600k -r 30 -dash 1 dash/426x240-30-600k.webm && \
ffmpeg -hide_banner -i original.mkv -c:v libvpx-vp9 -row-mt 1 -keyint_min 150 -g 150 -tile-columns 4 -frame-parallel 1 \
-movflags faststart -f webm -dash 1 -speed 3 -threads 4 -an -vf scale=640:360 -b:v 700k -r 30 -dash 1 dash/640x360-30-700k.webm && \
ffmpeg -hide_banner -i original.mkv -c:v libvpx-vp9 -row-mt 1 -keyint_min 150 -g 150 -tile-columns 4 -frame-parallel 1 \
-movflags faststart -f webm -dash 1 -speed 3 -threads 4 -an -vf scale=640:360 -b:v 900k -r 30 -dash 1 dash/640x360-30-900k.we
@dangayle
dangayle / isElementInViewport.js
Created Jan 4, 2019 — forked from davidtheclark/isElementInViewport.js
JavaScript: Is element in viewport?
View isElementInViewport.js
/*
No jQuery necessary.
Thanks to Dan's StackOverflow answer for this:
http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport
*/
function isElementInViewport(el) {
var rect = el.getBoundingClientRect();
return (
rect.top >= 0 &&
@dangayle
dangayle / classify_startstop.py
Created May 24, 2017 — forked from shivkanthb/classify_startstop.py
Subscribe and unsubscribe to messages
View classify_startstop.py
from textblob.classifiers import NaiveBayesClassifier
from textblob import TextBlob
train = [
('Take me off', 'stop'),
('Stop texting','stop'),
('stop messaging','stop'),
('Don\'t talk', 'stop'),
('Stop messaging','stop'),
('dont want to talk anymore','stop'),
@dangayle
dangayle / contact.html
Created May 10, 2017 — forked from tgroshon/contact.html
Formatted snippet authored by Jeff Richards (http://www.jrichards.ca/)
View contact.html
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
function submitToAPI() {
var URL =/contact’;
var data = {
name: $(‘#name-input’).val(),
email: $(‘#email-input’).val(),
description: $(‘#description-input’).val()
@dangayle
dangayle / app.js
Created Jan 2, 2017
Loading Tachyons using Webpack and React
View app.js
import React from 'react';
import Tachyons from 'tachyons/css/tachyons.min.css'
const App = () => (
<div className="mw9 center">
<h2 className="red sans-serif tc">Hello, world</h2>
</div>
);
export default App;
@dangayle
dangayle / methodology.md
Last active Aug 23, 2016
Calculate the population of an area affected by active wildfires
View methodology.md

Create estimate of population affected by active fires

The goal is to estimate the amount of people affected by active fires in a given area, using VIIRS satellite data and US Census data

  1. Cluster fire data points from VIIRS data into groups, representing active fire areas
  2. For each group, create a polygon that contains all points (a convex hull), this represents the boundaries of a given fire area
@dangayle
dangayle / srcset_resize.html
Created Jul 29, 2016
Using lazysizes in Django
View srcset_resize.html
{% load static mogrify %}
<img
class="lazyload {{ class }}"
src="{% static 'sv3/img/spokesman-logo.png' %}"
data-sizes="auto"
data-srcset="
{% mogrify img_url resize '300x169' %} 300w,
{% mogrify img_url resize '530x298' %} 530w,
{% mogrify img_url resize '720x408' %} 720w,
{% mogrify img_url resize '1170x658' %} 1170w,"
@dangayle
dangayle / vanilla-not-jquery.js
Created Jul 27, 2016 — forked from askesian/vanilla-not-jquery.js
Pure JS alternatives to common CSS class jQuery functions
View vanilla-not-jquery.js
function hasClass(elem, className) {
return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');
}
function addClass(elem, className) {
if (!hasClass(elem, className)) {
elem.className += ' ' + className;
}
}
View Start up local Docker Machine on OSX automatically.md

Requirements

  • Docker Machine + Docker
  • curl
  • A Virtualbox-driven Docker Machine called "default" docker-machine create --driver virtualbox default (this is the default with Docker toolkit).

Usage

The git.io URL (http://git.io/vsk46) is a shortened form of the raw url of the plist.

You can’t perform that action at this time.