Skip to content

Instantly share code, notes, and snippets.

View shengyou's full-sized avatar

Shengyou Fan shengyou

View GitHub Profile
@shengyou
shengyou / settings.json
Created August 26, 2016 08:59
我的 VS Code 設定
// Place your settings in this file to overwrite the default settings
{
// Editor
// Controls if the editor should automatically format the line after typing
"editor.formatOnType": true,
// Zoom the font of the editor when using mouse wheel and holding Ctrl
"editor.mouseWheelZoom": true,
@shengyou
shengyou / helpers.php
Last active March 12, 2023 14:49
env() helper functions without Laravel framework
<?php
if (! function_exists('env')) {
/**
* Gets the value of an environment variable. Supports boolean, empty and null.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
@shengyou
shengyou / phinx.php
Created October 4, 2016 15:56
setup phinx config using php instead of yaml file.
<?php
require __DIR__.'/bootstrap.php';
return [
'paths' => [
'migrations' => '%%PHINX_CONFIG_DIR%%/db/migrations',
'seeds' => '%%PHINX_CONFIG_DIR%%/db/seeds',
],
'environments' => [
# 更新套件清單
sudo apt update
# 升級套件
sudo apt upgrade
# 安裝套件
sudo apt install {package}
# 移除套件
@shengyou
shengyou / install.sh
Created December 15, 2017 16:43
install Linuxbrew
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
test -d ~/.linuxbrew && PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
test -d /home/linuxbrew/.linuxbrew && PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH"
test -r ~/.bash_profile && echo "export PATH='$(brew --prefix)/bin:$(brew --prefix)/sbin'":'"$PATH"' >>~/.bash_profile
echo "export PATH='$(brew --prefix)/bin:$(brew --prefix)/sbin'":'"$PATH"' >>~/.profile
sudo brew install {package}
sudo apt update
sudo apt install firefox
curl https://s3-us-west-2.amazonaws.com/brave-apt/keys.asc | sudo apt-key add -
echo "deb [arch=amd64] https://s3-us-west-2.amazonaws.com/brave-apt xenial main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install brave
sudo apt update
sudo apt install snapd