Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Ilyaev alexilyaev

View GitHub Profile
@alexilyaev
alexilyaev / test.directive.spec.js
Last active Aug 29, 2015
Simple Angular Directive spec boilerplate
View test.directive.spec.js
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 Aug 29, 2015
Angular Guidelines when using WebPack
View angular-webpack-guidelines.md

No more IIFE

  • WebPack wraps each requireed code with a function, so there's no need to wrap our code with an IIFE
/**
 * Good
 */
View naming-conventions.md

CSS

Use dash-cased class names

  • It's consistent with CSS property naming convention
.some-class-name {}
View webstorm-plugins.md
  • .ignore
  • BashSupport
  • Css Alphabetical Rearranger
  • GFM
  • Markdown Support
  • Presentation Assistant
@alexilyaev
alexilyaev / gh-pages-deploy.md
Created Apr 30, 2017 — 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).
View gh-pages-deploy.md

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 Jul 30, 2017
Gruntfile.js - JSHint, Uglify, SASS, Clean, Watch, Connect with LiveReload
View Gruntfile.js
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 Jul 31, 2017
Hyper.js configuration
View .hyper.js
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)',
View index.html
<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"
View canvas-ping-pong.markdown
@alexilyaev
alexilyaev / license-checker.js
Created Nov 19, 2017
A small script to check packages installed through npm against a whitelist of licenses and packages
View license-checker.js
'use strict';
const _ = require('lodash');
const winston = require('winston');
const checker = require('license-checker');
const chalk = require('chalk');
const licensesWeAreOKWith = `
MIT,
MIT*,