如何在開發的過程中加入測試。
- Model
- Repository
- Controller
- Auth
// ==UserScript== | |
// @name geektime copy | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description 让极客时间的内容可以复制! | |
// @author Rand01ph | |
// @match https://time.geekbang.org/column/* | |
// @grant none | |
// @require http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js | |
// ==/UserScript== |
<?php | |
namespace App\Traits; | |
trait UseAutoIncrementID { | |
/** | |
* Increment the counter and get the next sequence | |
* | |
* @param $collection |
<?php | |
$finder = Symfony\Component\Finder\Finder::create() | |
->notPath('bootstrap/cache') | |
->notPath('storage') | |
->notPath('vendor') | |
->in(__DIR__) | |
->name('*.php') | |
->ignoreDotFiles(true) | |
->ignoreVCS(true); |
<?php namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
/** | |
* If the incoming request is an OPTIONS request | |
* we will register a handler for the requested route | |
*/ | |
class CatchAllOptionsRequestsProvider extends ServiceProvider { |
// 检测浏览器的 User Agent 应该是非常简单的事情 | |
// 微信在 Android 下的 User Agent | |
mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/5.0.1.352 | |
// 微信在 iPhone 下的 User Agent | |
mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0 | |
// 通过javascript判断 | |
// 很容易看出来,微信的 User Agent 都有‘micromessenger’字符串标示,我们判断是否含有这些字符串就OK了 | |
function isWeixinBrowser(){ |
require('font-awesome/css/font-awesome.css'); | |
document.body.innerHTML = '<i class="fa fa-fw fa-question"></i>'; |
#!/bin/bash | |
CWD=$(pwd) | |
for REPO in `ls -d */.git` | |
do | |
DIR=`dirname $REPO` | |
echo "git -C $DIR up" | |
cd $DIR && git up | |
cd $CWD |
<?php | |
// requires php5 | |
define('UPLOAD_DIR', 'images/'); | |
$img = $_POST['img']; | |
$img = str_replace('data:image/png;base64,', '', $img); | |
$img = str_replace(' ', '+', $img); | |
$data = base64_decode($img); | |
$file = UPLOAD_DIR . uniqid() . '.png'; | |
$success = file_put_contents($file, $data); | |
print $success ? $file : 'Unable to save the file.'; |
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |