Skip to content

Instantly share code, notes, and snippets.

View qzm's full-sized avatar
🚀
I may be slow to respond.

Aaron Qiu qzm

🚀
I may be slow to respond.
View GitHub Profile
@qzm
qzm / bigNumberAdd.js
Created April 27, 2018 02:54
// 大数相加
// 大数相加
function add(a, b) {
var carry = 0;
var result = [];
var sum = 0;
var minLength = Math.min(a.length, b.length);
var maxLength = Math.max(a.length, b.length);
var aArrRe = a.split("").reverse();
var bArrRe = b.split("").reverse();
@qzm
qzm / install.sh
Created November 17, 2017 02:50
install docker in centos 7
yum install -y --setopt=obsoletes=0 \
docker-ce-17.03.1.ce-1.el7.centos \
docker-ce-selinux-17.03.1.ce-1.el7.centos
@qzm
qzm / Jenkinsfile
Last active April 2, 2023 18:36
Vue.js / Jenkinsfile /Pipelines
pipeline {
agent {
docker {
image 'node'
}
}
stages {
stage('Clone Sources') {
steps {
@qzm
qzm / install-tensorflow.sh
Created November 2, 2017 07:27 — forked from erikbern/install-tensorflow.sh
Installing TensorFlow on EC2
# Note – this is not a bash script (some of the steps require reboot)
# I named it .sh just so Github does correct syntax highlighting.
#
# This is also available as an AMI in us-east-1 (virginia): ami-cf5028a5
#
# The CUDA part is mostly based on this excellent blog post:
# http://tleyden.github.io/blog/2014/10/25/cuda-6-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/
# Install various packages
sudo apt-get update
@qzm
qzm / bubbleSort.js
Created October 9, 2017 02:04
Bubble Sort
function bubbleSort(arr) {
// copy
var newArr = [];
for (var index = 0; index < arr.length; index++) {
newArr[index] = arr[index];
}
// sort
var temp;
for (var i = 0; i < newArr.length; i++) {
for (var j = 0; j < (newArr.length - i); j++) {
@qzm
qzm / quickSort.js
Created October 9, 2017 01:55
quick sort
function quickSort(arr) {
if (arr.length <= 1) {
return arr;
}
var mid = [arr[0]];
var left = [];
var right = [];
for (var i = 1; i < arr.length; i++) {
if (arr[i] <= mid[0]) {
left.push(arr[i]);
@qzm
qzm / webp.nginx.conf
Created September 19, 2017 01:32
webp nginx configure
user www-data;
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
@qzm
qzm / gettype.js
Created August 6, 2017 07:03
gettype
/**
* 格式工厂,生成判断的函数
* @param {String} type
* @return {Function} 判断函数
*/
function typeFactory(type) {
return (obj) => {
return Object.prototype.toString.call(obj) === `[object ${type}]`;
}
}
@qzm
qzm / .gitignore
Last active January 21, 2021 08:32
为中国开发者准备的NPM配置文件(.npmrc)放置在npm运行的目录即可
node_modules/
@qzm
qzm / nginx.conf
Last active June 26, 2017 07:27
React.js Vue.js Nginx configuration
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;