Skip to content

Instantly share code, notes, and snippets.

View alexilyaev's full-sized avatar

Alex Ilyaev alexilyaev

View GitHub Profile
@alexilyaev
alexilyaev / test.directive.spec.js
Last active August 29, 2015 14:25
Simple Angular Directive spec boilerplate
describe('test.directive', function () {
'use strict';
var $rootScope;
var $scope;
var $compile;
var preCompiledElement;
var element;
var controller;
@alexilyaev
alexilyaev / angular-webpack-guidelines.md
Last active August 29, 2015 14:25
Angular Guidelines when using WebPack

No more IIFE

  • WebPack wraps each requireed code with a function, so there's no need to wrap our code with an IIFE
/**
 * Good
 */
@alexilyaev
alexilyaev / naming-conventions.md
Last active November 5, 2015 22:09
Naming Conventions

CSS

Use dash-cased class names

  • It's consistent with CSS property naming convention
.some-class-name {}
@alexilyaev
alexilyaev / webstorm-plugins.md
Last active January 4, 2017 13:28
WebStorm Plugins
  • .ignore
  • BashSupport
  • Css Alphabetical Rearranger
  • GFM
  • Markdown Support
  • Presentation Assistant
@alexilyaev
alexilyaev / gh-pages-deploy.md
Created April 30, 2017 12:19 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@alexilyaev
alexilyaev / Gruntfile.js
Last active July 30, 2017 13:06
Gruntfile.js - JSHint, Uglify, SASS, Clean, Watch, Connect with LiveReload
module.exports = function (grunt) {
'use strict';
var port = grunt.option('port') || 9001,
lrPort = grunt.option('lr-port') || 35731,
hostname = 'localhost',
baseFolder = '.';
// Display the elapsed execution time of grunt tasks
require('time-grunt')(grunt);
@alexilyaev
alexilyaev / .hyper.js
Last active July 31, 2017 09:14
Hyper.js configuration
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 16,
// font family with optional fallbacks
fontFamily: '"Fira Code", Monaco, Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248, 28, 229, 0.8)',
@alexilyaev
alexilyaev / index.html
Created November 16, 2017 15:12
SVG Tape
<svg width="500" height="300" viewBox="0 0 500 300">
<!-- Define components -->
<defs>
<g id="tape">
<rect width="450" height="200" fill="#222"
stroke="#aaa" stroke-width="5"/>
</g>
<g id="wheel">
<circle cx="50" cy="50" r="50"
@alexilyaev
alexilyaev / canvas-ping-pong.markdown
Created November 16, 2017 15:13
Canvas - Ping Pong
@alexilyaev
alexilyaev / license-checker.js
Created November 19, 2017 13:03
A small script to check packages installed through npm against a whitelist of licenses and packages
'use strict';
const _ = require('lodash');
const winston = require('winston');
const checker = require('license-checker');
const chalk = require('chalk');
const licensesWeAreOKWith = `
MIT,
MIT*,