Skip to content

Instantly share code, notes, and snippets.

View kopepasah's full-sized avatar
🤖
Solving problems with bots.

Justin Kopepasah kopepasah

🤖
Solving problems with bots.
View GitHub Profile
@tw2113
tw2113 / class.WDS_JetPack_Popular_Posts.php
Last active March 28, 2022 18:54
JetPack Popular Posts class.
@zsup
zsup / ddd.md
Last active November 9, 2024 06:01
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.
@norcross
norcross / gist-shortcode.php
Last active December 12, 2015 08:08
embed Gist shortcode
<?php
// usage: get the gist ID and place the shortcode in the site: [gist id="THE_ID"]
// allows for an optional title to display above, i.e [gist id="THE_ID" title="Some Title"]
// embed gists
function gist_shortcode($atts, $content = NULL) {
extract( shortcode_atts( array(
'id' => '',
'user' => 'norcross',
'title' => ''
@jonathandavis
jonathandavis / enhanced-storefront.php
Created November 9, 2012 18:20 — forked from kopepasah/shopp-account-menu.php
Creating an actual Shopp account menu for the account pages.
static function account_menuitem ($result, $options, $O) {
$Storefront = ShoppStorefront();
$page = current($Storefront->menus);
if (array_key_exists('url',$options)) return add_query_arg($page->request,'',shoppurl(false,'account'));
if (array_key_exists('action',$options)) return $page->request;
if (array_key_exists('classes',$options)) {
$classes = array($page->request);
if ($Storefront->account['request'] == $page->request) $classes[] = 'current';
return join(' ',$classes);
}
@norcross
norcross / gist-shortcode-css.css
Created October 1, 2012 15:38
embed gist shortcode
/* Optional CSS for themes that don't wrap the pre tag properly */
div.github-gist-block pre {
background-color: #F5F5F5;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px 4px 4px 4px;
display: block;
font-size: 13px;
line-height: 20px;
margin: 0 0 10px;
padding: 9.5px;
@mipmip
mipmip / gist:1844353
Created February 16, 2012 12:00
Mac OS X: restart mDNSResponder
Load up Terminal (Applications > Utilities > Terminal.app) and type the following.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
To turn it back on, just do the opposite:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
@scottkellum
scottkellum / normalized.html
Created December 6, 2011 14:58
pixel normalization
<!doctype html>
<html>
<head>
<!-- Encoding -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>