Skip to content

Instantly share code, notes, and snippets.

View ancillaryfactory's full-sized avatar

Jon Schwab ancillaryfactory

View GitHub Profile
@ancillaryfactory
ancillaryfactory / index.js
Created August 24, 2015 15:48
Fake endpoint
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use( bodyParser.json() );
app.post('/:id/', function (req, res) {
var firmId = req.params.id;
console.log('Firm ID ' + firmId);
@ancillaryfactory
ancillaryfactory / phpunit-symfony.sublime-snippet
Last active August 29, 2015 14:27
Symfony PHPUnit Test Starter
<snippet>
<content><![CDATA[
<?php
namespace AppBundle\Tests\\$1;
use AppBundle\\$1\\$2;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class $2Test extends WebTestCase
@ancillaryfactory
ancillaryfactory / Gulpfile.js
Created May 17, 2015 23:34
Basic Gulp Setup
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
gutil = require('gulp-util'),
livereload = require('gulp-livereload'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
ngAnnotate = require('gulp-ng-annotate'),
size = require('gulp-size');
@ancillaryfactory
ancillaryfactory / form.js
Last active August 29, 2015 14:20
Post WuFoo entry from NodeJS/Express
var express = require('express');
var router = express.Router();
var request = require("request");
router.post('/send', function(req, res, next) {
var entry = {
email: req.body.email,
comment: req.body.comment
}
@ancillaryfactory
ancillaryfactory / Gruntfile.js
Created March 17, 2014 02:31
Starter Gruntfile and package.json
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
compress: true
},
@ancillaryfactory
ancillaryfactory / new_post.py
Last active December 11, 2015 01:58
Utility to build new Pelican posts from the command line. Add new_post.py to the root Pelican directory and add the two lines below to Makefile. Type `make post` to run the script. NOTE: After the new post file is created, it's automatically opened in the text editor of your choice. I used Sublime Text in a Windows environment as the example.
post:
@python $(BASEDIR)/new_post.py "$(INPUTDIR)"
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
import os, sys, argparse, string
from pelican import __version__
TEMPLATES={
'Makefile' : '''
PELICAN=$pelican
PELICANOPTS=$pelicanopts
@ancillaryfactory
ancillaryfactory / Contract Killer 3.md
Created November 11, 2012 03:32 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@ancillaryfactory
ancillaryfactory / wordpress-subpages-menu.php
Created March 15, 2012 10:27 — forked from wvega/wordpress-subpages-menu.php
Wordpress: Add a subpages menu
<?php
function subpages() {
global $post;
// Output a link to the parent page, if we are on a subpage
if (!empty($post->post_parent)) {
$title = esc_attr(get_the_title($post->post_parent)) ?>
<p><b>Parent page:</b><br />
<a href="<?php echo get_permalink($post->post_parent); ?>" title="<?php echo esc_attr($title); ?>"><?php echo $title ?></a></p>