如何在開發的過程中加入測試。
- Model
- Repository
- Controller
- Auth
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt” | |
# Shamelessly copied from https://github.com/gf3/dotfiles | |
# Screenshot: http://i.imgur.com/s0Blh.png | |
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then | |
export TERM=gnome-256color | |
elif infocmp xterm-256color >/dev/null 2>&1; then | |
export TERM=xterm-256color | |
fi |
# 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 |
# 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\] ' |
<?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; |
<!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 | |
/** | |
* php-ansi-color | |
* | |
* Original | |
* https://github.com/loopj/commonjs-ansi-color | |
* | |
* @code | |
* <?php | |
* require_once "ansi-color.php"; |
#!/bin/bash | |
sudo add-apt-repository -y ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install git -y |
-- 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"; |
// 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(); | |
} |