Skip to content

Instantly share code, notes, and snippets.

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

小克 goodjack

:octocat:
嗨~
View GitHub Profile
@goodjack
goodjack / check-php-fpm.sh
Created March 22, 2018 07:52
Check PhpBrew PHP-FPM, auto restart PHP-FPM if it is down.
#!/bin/bash
source ~/.bashrc
port='9001'
check=$(netstat -na | grep "LISTEN" | grep "$port" | awk -F[:" "]+ '{print $5}')
if [[ "$check" != "$port" ]]; then
{
echo "PHP-FPM is down, restarting... $(date +"%F %T")"
service phpbrew-fpm restart
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int amount;
cout << "請輸入商品數";
cin >> amount;
int products[amount];
@goodjack
goodjack / .gitignore
Last active July 3, 2018 11:05
Visual Studio Code Extensions for Laravel Development
/.vscode/*
!/.vscode/extensions.json
@goodjack
goodjack / show_all_git_log.sh
Created July 24, 2018 10:30
顯示該目錄中所有 Git Repo 的最新 log 紀錄
find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo [{}] && cd {} && git log -1 --oneline --format="%C(auto) %h %s (%cr)")' \;
@goodjack
goodjack / settings.json
Created August 17, 2018 10:57
My VSCode settings.json
{
"auto-close-tag.fullMode": true,
"blade.format.enable": true,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.fontSize": 18,
"editor.formatOnPaste": true,
"editor.lineHeight": 32,
"editor.renderIndentGuides": false,
"editor.renderWhitespace": "boundary",
@goodjack
goodjack / scores0.cpp
Created November 13, 2018 12:34
[CS50 2018] [Lecture 2] Arrays (C++ version)
#include <iostream>
using namespace std;
int main(void) {
// 取得使用者的分數
int score1, score2, score3;
cout << "Score 1:";
cin >> score1;
cout << "Score 2:";
@goodjack
goodjack / string0.cpp
Last active November 13, 2018 16:33
[CS50 2018] [Lecture 2] String (C++ version)
#include <iostream>
using namespace std;
int main(void) {
string s;
cout << "Input: ";
cin >> s;
cout << "Output: ";
for (int i = 0; i < s.length(); i++)
@goodjack
goodjack / web.php
Created December 12, 2018 07:51
讓 Laravel 可以用網頁預覽測試 Markdown Mail
<?php
// 省略...
Route::get('mails/user', function () {
$markdown = new Illuminate\Mail\Markdown(view(), config('mail.markdown'));
$user = \App\User::first();
return $markdown->render('mails.user', [
'user' => $user,
@goodjack
goodjack / .gitignore
Created April 26, 2019 03:44 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
#include <iostream>
using namespace std;
int main() {
long long number;
cin >> number;
int oddSum = 0;
int evenSum = 0;