Skip to content

Instantly share code, notes, and snippets.

@theafolayan
theafolayan / 1_phpunit-api.md
Created November 19, 2020 00:06 — forked from loonies/1_phpunit-api.md
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this->anything()
@protist
protist / vimwiki-tree
Created March 9, 2015 10:47
Create a linkified vimwiki tree of the specified directory and subdirectories
#!/usr/bin/env bash
# Create a linkified vimwiki tree of the specified directory and subdirectories.
# It takes one argument: the base directory of the vimwiki.
# For the links to make sense, place the output of this script into a file located in this base directory.
# Print header
echo '= Wiki contents ='
echo
cd "$1"
@sstur
sstur / dom-to-json.js
Last active October 8, 2023 04:17
Stringify DOM nodes using JSON (and revive again)
function toJSON(node) {
let propFix = { for: 'htmlFor', class: 'className' };
let specialGetters = {
style: (node) => node.style.cssText,
};
let attrDefaultValues = { style: '' };
let obj = {
nodeType: node.nodeType,
};
if (node.tagName) {
@hucklesby
hucklesby / dabblet.css
Created October 18, 2013 23:02
Fit caption to the width of any image
/**
* Fit caption to the width of any image
*/
.captioned-figure {
display: table;
table-layout: fixed;
}
.captioned-figure img {
margin-bottom: 10px;
border: 0;