var createNamedParameters = require("./named-parameters")
var fn = createNamedParameters(["greeting", "person"], function(a, b) {
console.log(a, b)
})
fn.greeting("hello") // set a
fn.person("world") // set b
fn() // console.log gets run
View the repository: https://github.com/sirlancelot/chai-checkmark
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 = AddCustomCodePlugin | |
function AddCustomCodePlugin() {} | |
AddCustomCodePlugin.prototype.apply = function(compiler) { | |
var self = this | |
compiler.plugin("compilation", function(compilation) { | |
compilation.mainTemplate.plugin("local-vars", self.localVars.bind(self))) | |
}) | |
} |
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
var gulp = require("gulp"); | |
module.exports = runTasks; | |
// Run a series of subtasks and execute a callback when they're complete. | |
function runTasks(subTasks, next) { | |
// If no subTasks were provided, just move on. | |
if (!subTasks || !subTasks.length) | |
return void (typeof next === "function" && next()); | |
// Always use an array. |
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
var MultipleInstance = (function() { | |
var uid = 0; | |
function MultipleInstance() { | |
// Increment the ID and make it a read-only property | |
Object.defineProperty(this, "id", { __proto__: null, value: ++uid }); | |
} | |
return MultipleInstance; | |
}()); | |
MultipleInstance.prototype.whatever = function() { |
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
foo | |
k$ | |
[a-f]{4} | |
(...).*\1 | |
^(?!.*(.)(.)\2\1) | |
^(.)(.).*\2\1$ | |
^(?!(xx+)\1+$) | |
(.)(.\1){3} | |
^.{5}[^e]?$ | |
^(([147]4|40|3[269]|9[05]|[378]1).+|0[369]*|[81][257])*$ |
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
#!/bin/bash -e | |
# Clear up the log of any database added to the index before committing it. | |
git diff-index --name-only --cached HEAD \ | |
| grep -e "database/.*\.db" \ | |
| while read DB; do | |
echo "Truncating log table in database: $DB" | |
sqlite3 "$DB" "DELETE FROM bolt_log; VACUUM;" | |
git add "$DB" | |
done |
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
body::before { | |
content: ""; | |
height: 6px; | |
background-color: #8cc84b; | |
position: fixed; | |
left: 0; | |
right: 0; | |
top: 0; | |
} |
- Wait until at least April, when the ground softens.
- Dress warmly (think layers), bring a shovel and a lantern on a stick.
- Listen. Is someone coming?
- Cover your lantern with a blanket, wait.
- Continue. If you're not used to hard physical labor, wear weight-lifting gloves to avoid excess chafing.
- You may need a wheelbarrow. You probably should have brought a wheelbarrow.
- Come back with a wheelbarrow.
- Try to have the body you've always wanted back to your house by dawn.