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
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
const port = process.env.HOT_LOAD_PORT || 8888;
const config = {
entry: {
app: [
@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:

function List() {}
function EmptyList() {}
EmptyList.prototype = new List();
EmptyList.prototype.constructor = EmptyList;
EmptyList.prototype.toString = function() { return '()'; };
EmptyList.prototype.isEmpty = function() { return true; };
EmptyList.prototype.length = function() { return 0; };
EmptyList.prototype.push = function(x) { return new ListNode(x, this); };
@send2moran
send2moran / gist:a41c6c45df7b7b36bc6a
Last active August 29, 2015 14:24
Angular commit messages

Must be one of the following:

  • FEAT: A new feature
  • FIX: A bug fix
  • DOCS: Documentation only changes
  • STYLE: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • REFACTOR: A code change that neither fixes a bug or adds a feature
  • PERF: A code change that improves performance
  • TEST: Adding missing tests
β”œβ”€β”€ app
β”œβ”€β”€ lib
β”œβ”€β”€ components
β”œβ”€β”€ handlers
β”œβ”€β”€ home/
β”œβ”€β”€ components/
β”œβ”€β”€ ...
β”œβ”€β”€ HomeView.jsx
β”œβ”€β”€ styles.less
β”œβ”€β”€ about
@send2moran
send2moran / gist:525ce6be4210a07228c6
Last active October 4, 2015 19:07
eslintrc airbnb
{
"parser": "babel-eslint",
"plugins": [
"react"
],
"env": {
"browser": true,
"node": true
},
"ecmaFeatures": {
/**
* The base implementation of `_.flatten` with added support for restricting
* flattening and specifying the start index.
*
* @private
* @param {Array} array The array to flatten.
* @param {boolean} [isDeep] Specify a deep flatten.
* @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
* @returns {Array} Returns the new flattened array.
*/
'use strict';
angular.module('wpclp.cp').directive('cpMultiShareManager', function() {
return {
restrict: 'E',
replace: true,
scope: true,
link: function(scope, el, attr) {
},
var userProto = {
login: () => console.log('hello')
};
var User = (json) =>
Object.assign(Object.create(userProto),jsonFromServer,{
});
//Channel.js
Sdk.Channel = function (json) {
var __propMap = {
"id": {"prop": "channelId"},
"name": {"prop": "name"},
"watermarkImages": {"prop": "_watermarkImages", "class": Sdk.Image},
"currentProgram": {"prop": "currentProgram", "class": Sdk.Program},
"officialUrl": {"prop": "officialUrl"},
"callSign": {"prop": "callSign"},
"preRollUrl": {"prop": "preRollUrl"},