Skip to content

Instantly share code, notes, and snippets.

@ItsGenis
ItsGenis / tsconfig.spec.json
Last active January 26, 2019 21:41
tsconfig.spec.json angular src tests
"include": [
"**/*.spec.ts",
"**/*.d.ts",
"../modules/**/*.spec.ts"
]
@ItsGenis
ItsGenis / test.ts
Created January 26, 2019 21:24
angular src tests test.ts
const moduleContext = require.context('./../modules', true, /\.spec\.ts$/);
moduleContext.keys().map(moduleContext);
@ItsGenis
ItsGenis / angular.json
Last active January 26, 2019 21:25
angular out src blog
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.scss"
],
@ItsGenis
ItsGenis / angular.json
Created June 14, 2018 08:32
angular.json call css
"styles": [
"src/styles.scss",
"dist/my-shiny-library/_theme.scss"
],
@ItsGenis
ItsGenis / package.json
Last active June 14, 2018 08:28
package json scripts for css bundle with ng-packagr
"scripts": {
"build": "ng-packagr -p package.json",
"postbuild": "ts-node ./scripts/css-bundle.ts"
},
import { relative } from 'path';
import { Bundler } from 'scss-bundle';
import { writeFile } from 'fs-extra';
/** Bundles all SCSS files into a single file */
async function bundleScss() {
const { found, bundledContent, imports } = await new Bundler()
.Bundle('./src/_theme.scss', ['./src/**/*.scss']);
if (imports) {
@ItsGenis
ItsGenis / bitbucket-pipelines.yml
Created May 15, 2018 16:48
bitbucket pipelines example
image: node:6.9.4
pipelines:
default:
- step:
name: Build, test and check version
caches:
- node
script:
- npm install
@ItsGenis
ItsGenis / package.json
Created May 15, 2018 16:33
example package json to define script
{
"scripts": {
"version-check": "node version-check.js"
}
}
@ItsGenis
ItsGenis / version-check.js
Created May 15, 2018 16:32
version check script
function versionCheck() {
// Compare package.json version to version-lock.json
// log() if success
// throw() on error
}
try { versionCheck(); } catch(error) { throw(error); }
@ItsGenis
ItsGenis / gist:10379886
Created April 10, 2014 13:03
Open the current Terminal directory in Finder
/usr/bin/osascript -e "tell application \"Finder\" to open POSIX file \"`pwd`\""