This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'); | |
var path = require('path'); | |
// npm install these. | |
var glob = require('glob'); | |
var gonzales = require('gonzales-pe'); | |
var infile = 'sass/**/*.sass'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var infile = 'mycssfile.css;' | |
var input = fs.readFileSync(infile).toString(); | |
var parseTree = require('gonzales-pe').parse(input); | |
var output = []; | |
parseTree.traverseByType('selector', node => output.push(node.toString())); |
Annoyed by this error?
Error: [$injector:unpr] Unknown provider: cProvider <- c
This will help find non-annotated Angular things that will break when minified. Can also be used with ngmin/ng-annotate and ng-strict-di
to find instances where they didn't apply a fix or throw an informative error.
To do this, we must edit angular.js
.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Altered from http://stackoverflow.com/a/38311061/3150057 | |
const fs = require('fs'); | |
const sharp = require('sharp'); | |
const takeElementScreenshot = function (element, name) { | |
return protractor.promise | |
.all([ | |
element.getLocation(), | |
element.getSize(), | |
browser.takeScreenshot() | |
]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function invert(initial) { | |
return Object.keys(initial) | |
.reduce((obj, key) => { | |
obj[initial[key]] = key; | |
return obj; | |
}, {}); | |
} | |
const SELECTOR_FIRST_CHARS = { | |
ID: '#', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.onPageLoad = function () { | |
// Copied from protractor-testability-plugin. | |
return browser.executeScript(function () { | |
if (!window.angular) { | |
// TODO: This is very very very (very^n) dirty... | |
// but the only way right now to make protractor work without setting ignoreSynchronization. | |
window.angular = { | |
resumeBootstrap: function () { }, | |
module: function () { | |
return { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ValueAction { | |
constructor(value = 0) { | |
this.actions = 0; | |
this.redos = 0; | |
this.limit = -1; | |
this.data = { | |
value: value | |
}; | |
this.latest = this.data; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
touch foo | |
git add foo | |
git commit --message 'Create foo' | |
git checkout --branch one | |
echo one > foo | |
git commit --message 'Add one to foo' | |
git checkout --branch two master --no-track | |
echo two > foo | |
git commit --message 'Add two to foo' | |
git checkout master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git init | |
echo 'start' > start.txt | |
git add start.txt | |
git commit --message 'Initial commit' | |
git log | |
# Make a new branch | |
git branch new | |
git branch | |
git log new | |
git log master |