Skip to content

Instantly share code, notes, and snippets.

View xiaoxipang's full-sized avatar

Xiaoxi Pang xiaoxipang

  • Shopify
  • Canada
View GitHub Profile
@xiaoxipang
xiaoxipang / linux_commands.md
Last active July 19, 2020 19:47
Linxu Commands

Check the status of a tool sudo systemctl status docker

@xiaoxipang
xiaoxipang / rails_chapters_note.md
Last active February 26, 2020 03:46
Ruby on Rails Chapters Note

Chapter 1

Create a new app
rails new <app_name>

Install the gems
bundle install or bundle, which is the alias of the previous command.

Start server
rails server

@xiaoxipang
xiaoxipang / Basic.java
Last active June 8, 2019 21:38
Some Basic Operation for Algorithm in Java
/**
* String manipulation
*/
// 1. Parse string with delimiter
String phone = "012-3456789";
String[] output = phone.split("-");
// Note: When split string with delimater with "." or " ", instead of directly using them, we have to using the double slash
// to help, i.e.
String[] digits = version.split("\\.");
@xiaoxipang
xiaoxipang / settings.json
Created September 30, 2018 19:29
VSCode Settings
{
"workbench.startupEditor": "newUntitledFile",
"breadcrumbs.enabled": true
}
@xiaoxipang
xiaoxipang / Spring.md
Last active August 19, 2018 02:27
Spring.md

What is Spring framework

Spring is a dependency injection framework.

@Component will tell Spring to take over the instantiate of the class @Autowire will tell Spring to inject and instantiate the class in class

@Component
public class BusinessLogic(){
  // Dependency Injection
 @Autowire
@xiaoxipang
xiaoxipang / js
Created July 26, 2018 02:53
Insertion Sort
function insertionSort (nums) {
for(let i = 1; i < nums.length; i++){
let temp = nums[i];
let j = i - 1;
while(j >= 0 && temp < nums[j]){
console.log(nums);
nums[j+1] = nums[j];
j--;
}
nums[j + 1] = temp;
@xiaoxipang
xiaoxipang / zshrc
Created July 1, 2018 04:14
zshrc config
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Add auto suggestions
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
# Remove Default username
DEFAULT_USER=Zingoer
# Path to your oh-my-zsh installation.
@xiaoxipang
xiaoxipang / java-2d-array.md
Last active June 23, 2018 16:19
Java 2D Array

Create a new M*N 2D array:

int[][] matrix = new int[n][m];//first is the row numbers, second is the column numbers

Get the length of the M*N 2D array:

int n = matrix.length;//n rows
int m = matrix[0].length;//m columns