Skip to content

Instantly share code, notes, and snippets.

@toddb
toddb / jasmine_extensions.js
Created April 11, 2012 20:02 — forked from esbie/jasmine_extensions.js
Jasmine spy syntactic sugar for dealing with success/error callbacks (aka jQuery.ajax)
/**
* An extension that always calls success when a spy is called.
*
* @example
* spyOn(foo, 'bar').andCallSuccessWith("baz");
* var options = {
* success: jasmine.createSpy();
* }
* foo.bar(options);
* expect(options.success).toBeCalledWith("baz");
@toddb
toddb / changelog.gradle
Created June 3, 2012 00:30
Gradle integration to SVN to generate CHANGELOG from svn log (integration via svnkit)
/*
task changeLog(type: ReleaseNotes){
destFile file("CHANGELOG-DJANGO-SAMPLE")
url "http://django-page-cms.googlecode.com/svn/trunk/"
}
# gradle changeLog
Creates output (first entry only shown):
@toddb
toddb / markdown.gradle
Created June 5, 2012 09:58
Markdown script for usage of PegDown - converts md files into html
/*
* Adapted from https://raw.github.com/geb/geb-seconf-2012-slides/master/buildSrc/pegdown/src/main/groovy/org/gradle/plugins/pegdown/PegDown.groovy
*/
buildscript {
repositories {
mavenCentral()
}
dependencies {
define(['services/module', 'underscore'], function (module, _) {
'use strict';
function OrderResource($http, $q, link) {
// ... other functions removed: viewState, accessState, flattenResource
// viewState is a deeper resource
// accessState looks at the Accept headers
// flattenResource: flattens all of this for the client-side resource (in-memory model bound to view)
@toddb
toddb / build-tasks.ps1
Created August 9, 2011 06:34
Build tasks for powershell via psake
<#
Basic build tasks for SharePoint (or other projects) - using 7zip and GacUtil
$framework = '4.0x64'
. .\scripts\build-tasks.ps1
properties {
$project = "Sites"
@toddb
toddb / userDefineLang_Gradle.xml
Created June 4, 2012 20:26
Gradle language for Notepad++
<NotepadPlus>
<UserLang name="Gradle" ext="gradle">
<Settings>
<Global caseIgnored="yes" />
<TreatAsSymbol comment="yes" commentLine="yes" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">&quot;&apos;0&quot;&apos;0</Keywords>
<Keywords name="Folder+"></Keywords>