Skip to content

Instantly share code, notes, and snippets.

View seanhagen's full-sized avatar
:shipit:
coding

Sean Hagen seanhagen

:shipit:
coding
  • Flight Center Travel Group
  • Vancouver, British Columbia
  • 09:47 (UTC -07:00)
View GitHub Profile
@seanhagen
seanhagen / video.js
Created October 23, 2013 18:21
Example unit tests for Backbone.js model
describe( "Video model", function(){
var MOCK_GET_DATA = {
channelName: "tgndeveloperedu",
commentCount: 0,
defaultOrder: 0,
dislikeCount: 0,
facebookCount: "0",
googleCount: "0",
likeCount: 0,
@seanhagen
seanhagen / build.xml
Created November 12, 2013 20:15
Small Phing target to update a file with the current build version. Requires 'version' to be set in project.properties
<target name="-set.buildtime">
<php expression="date('Ymdhms');" returnProperty="build_time" />
<property name="build.version" value="${version}-${build_time}" />
<echo>Build number: ${build.version}</echo>
<delete file="${phing.dir}/build.txt" />
<echo file="${phing.dir}/build.txt">${build.version}</echo>
</target>
@seanhagen
seanhagen / build.xml
Last active December 28, 2015 03:49
Template for Phing build files
<?xml version="1.0" encoding="UTF-8" ?>
<project name="==PROJECT NAME HERE==" basedir="." default="main">
<!--
This is a file that should be in the same directory as this file.
It defines some basic variables for use in this build file.
Some variables are required for each project, regardless of type:
version: defines the current version of your project.
branch: defines the default branch to build
url: should always be defined, but empty
@seanhagen
seanhagen / composer.json
Last active December 28, 2015 03:49
Required dev libraries for code testing and analysis
"require-dev": {
"phpmd/phpmd": "dev-master",
"pdepend/pdepend": "dev-master",
"phploc/phploc": "2.0.*@dev",
"squizlabs/php_codesniffer": "dev-master",
"sebastian/phpcpd": "2.0.*@dev",
"sebastian/phpdcd": "1.0.*@dev",
"shrink/phpcpd": "dev-master",
"shrink/finder-facade": "dev-master",
"codeception/codeception": "dev-master",
@seanhagen
seanhagen / composer.json
Last active December 28, 2015 03:49
Required parts of a composer.json file to auto-update npm modules
"scripts": {
"post-install-cmd": [
"npm install"
],
"post-update-cmd": [
"npm install"
]
},
@seanhagen
seanhagen / package.json
Last active December 28, 2015 04:09
Example package.json
{
"name": "project-name-here",
"version": "0.0.1",
"author": "Your Name <your-email@example.com>",
"description": "Simple project description",
"dependencies": {
"grunt": "~0.4.1",
"grunt-cli": "~0.1.9",
"grunt-shell": "~0.4.0",
"grunt-env": "*",
@seanhagen
seanhagen / Gruntfile.js
Last active December 28, 2015 04:09
Example Gruntfile.js
module.exports = function(grunt){
require('load-grunt-tasks')(grunt);
var join = require("path").join;
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
env: {
@seanhagen
seanhagen / Emacs Tips.txt
Created November 13, 2013 08:49
Emacs Tips & Tricks
Indent By A Specific Number Of Spaces:
C-u # C-x TAB
Flyspell Correct Word ( cycles )
M-TAB
Flyspell GoTo Next Bad Spelling
C-,
@seanhagen
seanhagen / project.properties
Created November 19, 2013 19:54
Example project.properties file
version=0.1.0
branch=master
url=
urlBase=.192.168.0.161.xip.io
@seanhagen
seanhagen / pre-commit.txt
Created November 19, 2013 20:34
Pre-Commit Hook Example
#!/bin/bash
cd ${0%/*}
cd ../../code
bin/phing -f build.xml analyze-quick