Skip to content

Instantly share code, notes, and snippets.

@Kamilius
Kamilius / window-props-stub.js
Last active Jul 12, 2022
Stub window properties for Jasmine unit tests
View window-props-stub.js
describe('', () => {
let originalPluginReference;
let globalPluginStub;
beforeAll(() => {
// Backing up original property reference, so we could restore it
// after all tests being performed
originalPluginReference = window['GlobalPlugin'];
});
View gist:b339bab82e67b76c99c2260a00101f1e
{
"name": "tourist-club",
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@agm/core": {
"version": "1.0.0-beta.2",
"resolved": "https://registry.npmjs.org/@agm/core/-/core-1.0.0-beta.2.tgz",
"integrity": "sha512-3bdfvkWDmJszpj/F6Fzgv7sks0cs/cUEQPfs37tcJFz3jc62SsXy4TGb/WJT8FpH2nSGE6DonP8lXuFxB0lblQ=="
View webpack.config.js
/* eslint no-var: 0 */
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
var StyleLintPlugin = require('stylelint-webpack-plugin');
@Kamilius
Kamilius / webpack.config.js
Created Aug 3, 2016 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
View webpack.config.js
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@Kamilius
Kamilius / find-unused-sass-variables.sh
Created May 31, 2016 — forked from badsyntax/find-unused-sass-variables.sh
Find unused SCSS variables. Usage: `./find-unused-sass-variables.sh sassDir/`
View find-unused-sass-variables.sh
#!/usr/bin/env bash
#
# Approach:
# 1. Find variable declaration in the form of "$my-var: anyvalue"
# 2. Loop through found variables and find occurrences of each variable in all sass files
# 3. Filter out vars that occurred only once
if [ -z "$1" ]; then
echo "Please specify a directory as the first argument."
exit 1
@Kamilius
Kamilius / snippets.cson
Last active Oct 9, 2015
Snippet for Atom.io text editor's "react" package
View snippets.cson
# Snippet for ReactJS ES6 component template
'.source.js.jsx':
'React component template':
'prefix': 'comptempl'
'body': """
import React from 'react'
export default class ${1} extends React.Component {
constructor(props) {
super(props)