Skip to content

Instantly share code, notes, and snippets.

View dverbovyi's full-sized avatar

Dmytro Verbovyi dverbovyi

  • Ukraine, Lviv
  • 01:23 (UTC +03:00)
View GitHub Profile
@ebidel
ebidel / app.html
Last active May 1, 2021 15:42
Fast Polymer app loading - optimized for first render, progressively enhanced lazy loading
<!DOCTYPE html>
<html>
<head>
<style>
body.loading #splash {
opacity: 1;
}
#splash {
position: absolute;
top: 0;
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active June 4, 2024 09:34
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@jreading
jreading / gist:4437292
Last active January 21, 2017 17:54 — forked from garth/gist:1388969
var css = 'insert lots of css here';
var files = {};
css = css.replace(/url\(["']?(\S*)\.(png|jpg|jpeg|gif)["']?\)/g, function(match, file, type)
{
var fileName = file + '.' + type;
var size = fs.statSync(fileName).size;
if (size > 4096) {
console.log('Skipping ' + fileName + ' (' + (Math.round(size/1024*100)/100) + 'k)');
return match;
@garth
garth / gist:1388969
Created November 23, 2011 15:29
Convert url image ref into inline base 64 in css with nodejs
var css = 'insert lots of css here';
var files = {};
css = css.replace(/url\((\S*)\.(png|jpg|jpeg|gif)\)/g, function(match, file, type)
{
var fileName = file + '.' + type;
var size = fs.statSync(fileName).size;
if (size > 4096) {
console.log('Skipping ' + fileName + ' (' + (Math.round(size/1024*100)/100) + 'k)');
return match;