An example of an AngularJS directive with state. This directive provides a delete confirmation widget, and the state is managed in the directive's controller.
A Pen by Ryan Brooks on CodePen.
FILE_TO_DELETE="target" | |
# Filter the history | |
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch ${FILE_TO_DELETE' --prune-empty --tag-name-filter cat -- --all | |
# Purge the local repository and force garbage collection | |
rm -rf .git/refs/original/ | |
git reflog expire --expire=now --all | |
git gc --prune=now | |
git gc --aggressive --prune=now |
// Generated on 2013-12-20 using generator-angular 0.6.0 | |
'use strict'; | |
// # Globbing | |
// for performance reasons we're only matching one level down: | |
// 'test/spec/{,*/}*.js' | |
// use this if you want to recursively match all subfolders: | |
// 'test/spec/**/*.js' | |
module.exports = function (grunt) { |
import org.gradle.api.tasks.Exec | |
defaultTasks 'bower' | |
// Get the path for the locally installed binaries | |
task npmBin << { | |
new ByteArrayOutputStream().withStream { os -> | |
def result = exec { | |
executable = 'npm' | |
args = ['bin'] |
An example of an AngularJS directive with state. This directive provides a delete confirmation widget, and the state is managed in the directive's controller.
A Pen by Ryan Brooks on CodePen.
See http://ryanbrooks.co.uk/posts/2014-02-06-geb-doubleclick.html for more information.
def credential = MC.createMongoCRCredential( "server", "db", "pass".toCharArray() ) | |
def mongoClient = new MongoClient( new ServerAddress("ds033429.mongolab.com", 33429), [ credential ] ) | |
def mongo = new GMongo( mongoClient ) | |
def db = mongo.getDB("CloudFoundry_8sbeqjqe_6hqm0ehp") | |
map.each { key, value -> | |
db.riverlevelsgroovy << value | |
} |
def show(Widget widget){ | |
// renders a blank page for null objects | |
respond widget, [model: [widget: widget]] | |
} |
I really do get on well with docpad. Despite wanting to move to a JVM-based static site generator, docpad does too many things to make me want to leave. It's not perfect, but it has plugins to solve mosts of your basic problems, and is nicely hackable. Plus it's written in CoffeScript, which is always a plus. Adding comments to the homepage blog entry was a little tricky though
The services plugin provides a neat way to inject Disqus comment threads into your pages. It's almost no configuration, and works reliably, but it doesn't work when you're rendering dynamic content, for example the latest blog post on your home page.
Everything worked well until Disqus got confused. First it displayed the comments from a blog post on the homepage when it was no longer correct. Then it just started displaying the comment thread on all pages which didn't have their own threads already. Not so good.
package my.package | |
class LittleFunctionSpec extends Specification{ | |
Context context | |
Scriptable scope | |
/** | |
* Setup, prior to every spec test | |
*/ | |
void setup(){ |