git clone <repo>
clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS
Add colors to your ~/.gitconfig file:
CREATE TABLE IF NOT EXISTS `country` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`iso` char(2) NOT NULL, | |
`name` varchar(80) NOT NULL, | |
`nicename` varchar(80) NOT NULL, | |
`iso3` char(3) DEFAULT NULL, | |
`numcode` smallint(6) DEFAULT NULL, | |
`phonecode` int(5) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |
CREATE TABLE IF NOT EXISTS `continents` ( | |
`code` CHAR(2) NOT NULL COMMENT 'Continent code', | |
`name` VARCHAR(255), | |
PRIMARY KEY (`code`) | |
) ENGINE=InnoDB; | |
INSERT INTO `continents` VALUES | |
('AF', 'Africa'), | |
('AS', 'Asia'), | |
('EU', 'Europe'), |
Validation Errors and Rollback | |
A common use case is to rollback a transaction if there are validation errors. For example consider this service: | |
import grails.validation.ValidationException | |
class AuthorService { | |
void updateAge(id, int age) { | |
def author = Author.get(id) | |
author.age = age | |
if (!author.validate()) { |
#!/usr/bin/php | |
<?php | |
/* | |
* Copyright 2013 | |
* Jeff Bickart | |
* @bickart | |
* jeff @ neposystems.com | |
*/ |
git shortlog -e -s -n |
<?php | |
//Define a new Interface for all 'shapes' to inherit | |
interface Shape { | |
//Define the methods required for classes to implement | |
public function getColor(); | |
public function setColor($color); |
// X-browser print local datetime w/ yyyy-MM-dd HH:mm:ss TZInfo format | |
// e.g. 2014-11-20 03:16:26 GMT+0900 (JST) | |
// @author noromanba http://flavors.me/noromanba | |
// @license CC0 Univ PD http://creativecommons.org/publicdomain/zero/1.0 | |
// c.f. | |
// https://gist.github.com/noromanba/6736822 | |
// http://let.hatelabo.jp/noromanba/let/hJmcrJfO94ka/rev/hJmcruLM2p0H | |
// http://let.hatelabo.jp/noromanba/let/hJmcrJfO94ka | |
var toDateTimeTZInfoString = (function () { |