Skip to content

Instantly share code, notes, and snippets.

View vikbert's full-sized avatar

Xun Zhou vikbert

View GitHub Profile
@vikbert
vikbert / xcode.md
Last active April 7, 2018 00:51
[xcode] install xcode on mac OS #xcode, #mac

Error message after upgrade MacOS:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun.

handling error: install macvim vim

brew uninstall vim macvim
brew uninstall python3
brew uninstall --ignore-dependencies python3
@vikbert
vikbert / nginx.md
Last active March 29, 2018 15:10
[nginx] nginx config and tips #nginx #web-server

caching static resources

    location ~*  ^.+\.(jpg|jpeg|png|gif|ico|svg|css|js)$ {
        expires max;
    }

basic authentication

@vikbert
vikbert / ssh.md
Last active July 4, 2018 19:12
[ssh] ssh relevant infos #ssh, #bash

remote command

ssh xzhou@live1 'bash -s' < pwd.sh

ssh generate pub key

ssh-keygen -t rsa -b 4096
@vikbert
vikbert / fish_how_to.md
Last active July 8, 2019 20:31
[fish shell] config fish shell on mac #fish, #shell
@vikbert
vikbert / cron.md
Last active April 6, 2018 13:10
[contab] organize the crontab smartly #cron, #crontab

Cron Job

Commands

crontab -e
crontab -l

How to start editing cron jobs

env EDITOR=vim crontab -e or crontab -e

@vikbert
vikbert / ionic.md
Last active March 29, 2018 17:03
[ionic] ionic framework #ionic, #mobile, #angularjs
@vikbert
vikbert / weex.md
Last active April 8, 2018 16:18
[weex] weex vuejs mobile app dev #weex, #vuejs
@vikbert
vikbert / node.md
Last active March 18, 2025 05:03
[node npm] nodejs, npm #node, #npm

How to install node latest

brew install node

Kill node processes

killall -9 node

How to install node by given version

@vikbert
vikbert / python.md
Created March 30, 2018 16:06
[python] install config downgrade python #python

downgrade python

current python version was 3.6.4 python --help

But for compiler electron app, I need the previous version Python >= v2.5.0 & < 3.0.0

brew install pyenv
pyenv install 2.7.10
pyenv global 2.7.10
@vikbert
vikbert / php-good-bad.md
Last active April 6, 2019 07:12
[PHP God Bad] PHP snippets #php, #snippet

convert object toArray

public function toArray(): array
{
  $properties = get_object_vars($this);
  $output = [];
  foreach ($properties as $name => $value) {
    $output[ucfirst($name)] = $value;
  }