- greenkeeper
when one of your projects' dependencies releases a new version, creates a pull request to update it
install:npm i greenkeeper -g
, run:gk enable
- npm-check
command line tool which checks your projects dependencies, tells you when there are any out of date, upgrades them
install:npm i npm-check -g
, run:npm-check -u
- fixpack
checks yourpackage.json
file to make sure it has important fields, organizes fields consistently
This file contains 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
new SpikeDatoCMS({ | |
addDataTo: locals, | |
token: 'xxx', | |
templates: [ | |
{ | |
collection: (dato) => dato.blogPosts, | |
path: 'templates/post.html', | |
output: (post) => { return `posts/${post.slug}.html` } | |
} | |
] |
This file contains 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
extend(src='layout.sgr') | |
block(name='content') | |
.post(md). | |
# A markdown post | |
Here you can write **pure markdown** without issue. | |
You can treat this entire block like it's a normal markdown file and it will be compiled as such. Pretty cool! Everything works -- headlines, links, etc. | |
.footnote What's nice is that if you need to inject some extra html, javascript, add another block to change the title, etc. this is very simple to do since you have the capability to write full html with a reshape file as opposed to markdown. |
This file contains 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
--- | |
title: 'wow' | |
--- | |
hello, this is **markdown**! |
This file contains 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
module.exports = function (source) { | |
console.log(this.query) // { foo: [null] } -- this is because when it's json serialized, it nulls out functions | |
const realOptions = this.options.module.rules.reduce((m, r) => { | |
const fooLoaderUse = r.use.find((u) => u.loader === 'foo-loader') | |
return fooLoaderUse ? fooLoaderUse.options : m | |
}, null) | |
console.log(realOptions) // foo: [() => 'bar'] -- it works, but is v. ugly | |
} |
This file contains 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
/** | |
* Requires a library, but only loads it when it's actually used. | |
* | |
* lazy_require('fs'); | |
* fs.readFileSync('example.js'); | |
* | |
* var wow = lazy_require('fs'); | |
* wow.readFileSync('example.js'); | |
* | |
* @param {String} lib - name of the lib you want to load |
This file contains 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
/** | |
* @param {number} n - integer (n >= 0) | |
* @param {number} d - digit (0 <= d <= 9) | |
* square all numbers k between 0 and n (0 <= k <= n) | |
* count the number of digits d used in the k*k's | |
* example | |
* | |
* n = 10 | |
* d = 1 |
This file contains 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
# Config Notes | |
# Dependencies: rbenv, ruby 1.9.3-p0, pow, powder, git, git_completion, grc | |
# | |
# path: | |
PS1='\[\e[0;31m\]⚡\[\e[m\] \[\e[0;30m\]${PWD##*/}\[\e[39m\] \[\e[0;33m\]$(__git_ps1 "(%s) ")\[\e[m\]' | |
# pretty colors (brew install grc) | |
source "`brew --prefix grc`/etc/grc.bashrc" |
In this release of spike, we switch posthtml for reshape. Reshape is a complete rewrite of posthtml by the static-dev team with several significant differences:
- It returns a function by default, so that its results can be used as client-side templates
- It has a much more clear and robust error reporting system, reporting errors that include the line/col in the original source, and exposing a code snippet to show where it came from
- It has more clearly written documentation, more thorough tests, consistent code style, and 100% coverage on all core modules
However, as a consequence of this move, the jade plugin is no longer available. The jade plugin was always a hack, and had several crippling caveats. In addition, jade does not fit well with reshape's philosophy of breaking functionality down into small modules. As such, we have replaced ja
This file contains 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 serializeVerbatim (obj) { | |
let i = 0 | |
const fns = [] | |
let res = JSON.stringify(obj, (k, v) => { | |
if (typeof v === 'function') { | |
fns.push(v.toString()) | |
return `__REPLACE${i++}` | |
} else { | |
return v | |
} |