Skip to content

Instantly share code, notes, and snippets.

View send2moran's full-sized avatar
🎯
Focusing

Moran Helman send2moran

🎯
Focusing
  • Tel Aviv, Israel
View GitHub Profile
@send2moran
send2moran / transcodeVideo.js
Last active August 29, 2015 14:15 — forked from Marak/transcodeVideo.js
Hook for transcoding video streams using FFMpeg
var Transcoder = require('stream-transcoder');
module['exports'] = function transcodeVideoStream (hook) {
var readStream = hook.open(hook.params.video);
hook.debug('Opening read stream to video');
hook.res.writeHead(200, {
"Content-Type": "video/mp4"
});
@send2moran
send2moran / noncritcss.md
Last active August 28, 2015 18:35 — forked from scottjehl/noncritcss.md
Comparing two ways to load non-critical CSS

I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.

TL;DR: Here's the solution I ended up with: https://github.com/filamentgroup/loadCSS/


For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: https://gist.github.com/igrigorik/2935269#file-notes-md ).

Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:

@send2moran
send2moran / mq_all.css
Created November 5, 2015 10:01 — forked from livercake/mq_all.css
Media Queries
/* Smartphones (portrait & landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {