如何在開發的過程中加入測試。
- Model
- Repository
- Controller
- Auth
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
// In this example we detect if a user clicks a link to travel elsewhere | |
// but has made changes to a form. If they have changed the form it prompts | |
// them to confirm before continuing. | |
jQuery(function ($) { | |
var $form = $('form').watchChanges(); | |
$('a').click(function (e) { | |
if ($form.hasChanged() and ! confirm('Continue without saving changes?')) { | |
e.preventDefault(); | |
} |
-- phpMyAdmin SQL Dump | |
-- version 2.10.3 | |
-- http://www.phpmyadmin.net | |
-- | |
-- 主機: localhost | |
-- 建立日期: Mar 12, 2013, 03:16 PM | |
-- 伺服器版本: 5.0.51 | |
-- PHP 版本: 5.2.6 | |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
#!/bin/bash | |
sudo add-apt-repository -y ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install git -y |
<?php | |
/** | |
* php-ansi-color | |
* | |
* Original | |
* https://github.com/loopj/commonjs-ansi-color | |
* | |
* @code | |
* <?php | |
* require_once "ansi-color.php"; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Star Rating System</title> | |
<meta name="viewport" content="width=device-width"> | |
<style> | |
.star{ | |
color: goldenrod; | |
font-size: 2.0rem; |
<?php | |
namespace PHP81_BC; | |
/** | |
* Locale-formatted strftime using IntlDateFormatter (PHP 8.1 compatible) | |
* This provides a cross-platform alternative to strftime() for when it will be removed from PHP. | |
* Note that output can be slightly different between libc sprintf and this function as it is using ICU. | |
* | |
* Usage: | |
* use func \PHP81_BC\strftime; |
# git prompt | |
# from http://gist.github.com/47364 | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "⚡" | |
} | |
function git_prompt { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} | |
export PS1='\[\e[1;33m\]\W\[\e[1;36m\]$(git_prompt)\[\e[1;33m\]$\[\e[m\] ' |
# to get a git prompt: | |
source /usr/share/git/completion/git-prompt.sh | |
GIT_PS1_SHOWDIRTYSTATE=true | |
#GIT_PS1_SHOWSTASHSTATE=true | |
GIT_PS1_SHOWUNTRACKEDFILES=true | |
GIT_PS1_SHOWCOLORHINTS=true | |
# colorize bash prompt | |
# see also http://misc.flogisoft.com/bash/tip_colors_and_formatting | |
#PS1='[\u@\h \W]\$ ' # To leave the default one |