Skip to content

Instantly share code, notes, and snippets.

View goodjack's full-sized avatar
:octocat:
嗨~

小克 goodjack

:octocat:
嗨~
View GitHub Profile
@goodjack
goodjack / log4php-for-laravel.php
Last active August 11, 2017 09:45 — forked from technoknol/log4php-for-laravel.php
Working log4php in Laravel (5.4)
<?php
// Middleware:
// app\Http\Middleware\Log4php.php
namespace App\Http\Middleware;
use Closure;
class Log4php
{
### brew list ###
android-platform-tools gobject-introspection libxml2 pixman
atk graphite2 little-cms pkg-config
atkmm graphviz little-cms2 poppler
autoconf gsettings-desktop-schemas lua popt
autojump gsl lzlib potrace
automake gtk+ mcrypt protobuf
bdw-gc gtkmm memcached pyenv
boost harfbuzz mhash python
@goodjack
goodjack / hello_world_and_if_else.cpp
Created October 2, 2017 09:42
1. 參考解答:Hello World and if/else
#include <iostream>
using namespace std;
int main()
{
   // 輸出 “Hello World”
   cout << "Hello World";
   // 判斷 num 是偶數還是奇數
   int num = 5; // 指定整數變數 num 為 5
@goodjack
goodjack / 20171005.cpp
Last active October 15, 2017 14:32
20171005 各種觀念混合範例(if/else if/else、&&、||、cin)
#include <iostream>
using namespace std;
int main ()
{
// 這是單行註解,我要開始宣告了!
int dividend = 5, divisor; // 第一個整數是寫死的,是被除數;第二個整數是除數。
cout << "請輸入除數:";
cin >> divisor; // 除數在這裡給使用者輸入儲存
@goodjack
goodjack / while-score.cpp
Last active November 4, 2017 12:43
While 迴圈之成績判斷參考解答
#include <iostream>
using namespace std;
int main()
{
int score;
cout << "==========================================\n";
cout << "成績判定,輸入範圍 0 ~ 100,超過範圍就掰掰\n";
cout << "==========================================\n";
@goodjack
goodjack / fibonacci_sequence.cpp
Created November 15, 2017 10:01
費氏數列
#include <iostream>
using namespace std;
int main()
{
int numA = 1, numB = 1;
cout << numA << ", " << numB << ", ";
int oldNumA, oldNumB;
@goodjack
goodjack / phpbrew-config.md
Created November 26, 2017 13:22 — forked from yang-wei/phpbrew-config.md
How to use switch PHP(using phpbrew) version in nginx config
php -v
PHP 5.6.3 (cli) (built: Oct 28 2015 09:47:41)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies

But this only changes in CLI. You have to tweak you nginx(same for apache) to make it works. Nginx will still using the native PHP-FPM.

> ps aux | grep php-fpm
@goodjack
goodjack / 20171123_array.cpp
Last active December 9, 2017 03:29
20171123 使用陣列參考解答 & 20171207 多重 for 迴圈時鐘範例
#include <iostream>
using namespace std;
int main()
{
int students, total = 0;
cout << "班級人數:";
cin >> students;
@goodjack
goodjack / score_avg.cpp
Created January 3, 2018 15:22
成績查詢系統 參考解答
#include <iostream>
using namespace std;
int main() {
cout << "歡迎進入成績查詢系統" << endl;
cout << "==============================" << endl;
int classSize;
cout << "班級人數:";
cin >> classSize;
@goodjack
goodjack / sum_function.cpp
Created January 4, 2018 16:16
20180105 課堂範例:function、switch 和 三元運算式
#include <iostream>
using namespace std;
// 先宣告一個 function(函數、函式)
// 第一個 int 代表回到上一層 function 時,return 值的型態
// 第二個 int 代表代進去的值的型態
int sum(int, int);
int main() {
int num1, num2;