Place the preseed.cfg
into a directory named http
, so your file structure would look like this:
/
- http
- preseed.cgf
- box.json
/** | |
* Disclamer: This is sort of a rant, but without any negative feelings towards the creators of the project | |
* in question. | |
* I value their desire to help people write more readable code, and wish there were more people doing this! | |
* The only thing I'm questioning is the ever growing trend of tools over craft. | |
* | |
* This is a mini blog-post in response to https://twitter.com/hhariri/status/435457449232171008 | |
* | |
* The reason I have some negative feelings is that writing readable code is not rocket | |
* science, and with tools like Spek, we're basically allowing people to be ignorant about crafting clean |
grunt.loadNpmTasks('grunt-appcache'); // Handles the appcache | |
grunt.loadNpmTasks('grunt-contrib-jshint'); // Checks if javascript codes are nice or not | |
grunt.loadNpmTasks('grunt-contrib-clean'); // Removes generated assets | |
grunt.loadNpmTasks('grunt-contrib-compass'); // Sass shorthands | |
grunt.loadNpmTasks('grunt-contrib-copy'); // Copies files | |
grunt.loadNpmTasks('grunt-contrib-cssmin'); // Minifies CSS | |
grunt.loadNpmTasks('grunt-contrib-watch'); // Watches for changes and acts on them | |
grunt.loadNpmTasks('grunt-css-metrics'); // Makes sure we don't overdo css files |
#!/bin/sh | |
# | |
# Pre-commit hooks | |
compileResult=0 | |
# Compress stuff before committing | |
SRC_PATTERN="(\.css|\.scss|\.svg)" | |
git diff --cached --name-only | if egrep "$SRC_PATTERN" | |
then | |
echo "----> Found CSS changes, updating the compressed versions" | |
node_modules/.bin/grunt |
Place the preseed.cfg
into a directory named http
, so your file structure would look like this:
/
<?php | |
class TimeValidator | |
{ | |
public function isValid($time_specification) | |
{ | |
return 1 == preg_match($this->buildRegExp(), $time_specification); | |
} | |
private function buildRegExp() |
class Book { | |
private String title; | |
private String author; | |
private int price; | |
public String getTitle() { | |
return title; | |
} | |
class Book { | |
public String title; | |
public String author; | |
public int price; | |
} |
class Book { | |
private String title; | |
private String author; | |
private int price; | |
public Book(String title, String author, int price) { | |
this.title = title; | |
this.author = author; | |
this.price = price; |
class BookConsumer { | |
public void printTheTitleOfABook(Book book) { | |
if(!book.getTitle().isEmpty()) { | |
System.out.println(book.getTitle()); | |
} | |
} | |
} |
public class GreetPrinter { | |
public void static main(String[] args) { | |
User user = new User(); | |
if (args.length > 1) { | |
user.setEmail(args[0]); | |
} | |
Greeter greeter = new Greeter(); | |
String msg = greeter.greetMessage(user); | |
if (msg != null) { | |
System.out.println(msg); |