Skip to content

Instantly share code, notes, and snippets.

View dvdrtrgn's full-sized avatar
🐢
nibbling

David dvdrtrgn

🐢
nibbling
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dvdrtrgn on github.
  • I am dvdrtrgn (https://keybase.io/dvdrtrgn) on keybase.
  • I have a public key ASBRWDh7m9c_XFjIT-wRp8IMr3LjbT_xLlH3uWYcDQiTIwo

To claim this, I am signing this object:

@dvdrtrgn
dvdrtrgn / fixed-bkgr.css
Created April 27, 2021 21:56
Fixed body background cover on mobile
body::after {
background-image: url(./images/bkgr.png);
background-position: center;
background-size: cover;
content: '';
position: fixed;
bottom: 0;
left: 0;
right: 0;
@dvdrtrgn
dvdrtrgn / index.js
Last active May 11, 2022 02:45
Extended Class order of inits
#!/usr/bin/env node
let C = console;
class C0 {
constructor() {
C.log(`C0 construct’d`);
C.log(`C0 this’d`, this);
}
foo = (() => C.log(`C0 init`))() || `C0 init`;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
document.body.innerText = '';
@dvdrtrgn
dvdrtrgn / video-fix-videos-for-pseudo-streaming.md
Created January 10, 2018 16:42 — forked from alienresident/video-fix-videos-for-pseudo-streaming.md
How to: Fix pseudo-streaming videos by moving Moov Atom
How to:

Fix pseudo-streaming videos by moving Moov Atom

Relies on some *nix CLI utilities: mediainfo; and qt-faststart (part of ffmpeg). I used homebrew to install them on OS X.

What is pseudo-streaming?

Pseudo streaming is simply a video that can start playing before it's fully dowmloaded. The videos are not streaming but rather progressively downloaded. What's important is that the file metadata (the Moov Atom) is at the start of the file rather than at the end. Usually this is an option set when encoding the file (called quick start or web start). If the files have not been encoded this way you can either re-encode or use a utility to move the Moov Atom. Re-encoding takes much longer than using a utility to move the Moov Atom so here's how to do it.

Steps

First check with mediainfo to see if video 'is streamable':

@dvdrtrgn
dvdrtrgn / dematrix.amd.js
Last active May 12, 2021 18:01
Take css transform gibberish; output sanity (to be continued)
/*
DeMatrix
Take css transform gibberish; output sanity.
*/
define([], function () {
function DeMatrix(a, b, c, d, e, f) {
return {
a,
b,
c,
@dvdrtrgn
dvdrtrgn / fix-homebrew-npm.md
Last active December 30, 2018 05:16 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

var states_abbr = {
AL: 'Alabama',
AK: 'Alaska',
AZ: 'Arizona',
AR: 'Arkansas',
CA: 'California',
CO: 'Colorado',
CT: 'Connecticut',
DE: 'Delaware',
FL: 'Florida',
@dvdrtrgn
dvdrtrgn / bbone
Last active March 20, 2016 03:34
head plug for basic backbone
<head>
<title>Simple Backbone</title>
<!-- http://backbonejs.org -->
<!-- http://devdocs.io/backbone -->
<!-- https://gist.github.com/dvdrtrgn/cdd7c3848a33d581df64.js -->
<!-- https://gist.githubusercontent.com/dvdrtrgn/cdd7c3848a33d581df64/raw -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.6.1/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.2.3/backbone.js"></script>
</head>