Your repository has two commits:
$ git log --oneline
957fbfb No, I am your father.
9bb71ff A long time ago in a galaxy far, far away....
// saving from url to a file (append) | |
new File("output.xml") << new URL ("http://some.url/some/path.xml").getText() |
package com.jetbootlabs.services | |
/* | |
* Truncates H2 tables mapped by the domainClasses variable. Useful for cleaning up test data. | |
* | |
* Temporarily disables referential integrity to avoid constraint violation errors when | |
* deleting records. | |
* | |
* Inspired by Luke Daley's blog post on how to do this in MySQL: | |
* http://ldaley.com/post/398082618/brute-force-fixture-cleanup-in-grails |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.util.Date; | |
import java.util.HashMap; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.Map; |
/** Within the controller method **/ | |
// If this is an ajax request, then return a JSON string | |
if ( $this->input->is_ajax_request() ): | |
$this->output->set_content_type('application/json'); | |
$this->output->set_output( json_encode($data) ); | |
endif; |
package gvl | |
import grails.converters.JSON | |
class ErrorController { | |
// Forbidden | |
def error403() { | |
withFormat { | |
html { render(view: 'error403') } |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
git rebase --interactive HEAD~2 | |
# we are going to squash c into b | |
pick b76d157 b | |
pick a931ac7 c | |
# squash c into b | |
pick b76d157 b | |
s a931ac7 c |
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
Javascript has two kinds of scope:
var
keywords creates the variable in the current scope
var
is unnecessary (see below)var
, then Javascript goes up the “scope chain” to see if it’s already been declared