Skip to content

Instantly share code, notes, and snippets.

@jackyshan
jackyshan / ping.sh
Created Jan 17, 2019
查找局域网ip列表
View ping.sh
#!/bin/bash
loop=1
host="172.31.42."
while(( $loop<=254 ))
do
ip="$host$loop"
# echo $ip
let "loop++"
@jackyshan
jackyshan / mogno.sql
Created Dec 28, 2018
mongodb日常操作
View mogno.sql
//查找单个字段
db.users.find({_id:ObjectId("5c25b4fdc32ea0b85da2a3bc")}, {"address":1})
//更新数组
db.users.update({_id:ObjectId("5c25b504c32ea0b85da2a3bd")}, {$push:{address:ObjectId("5c25cf01c32ea0b85da2a3c8")}})
//一对多关系查询
var result = db.users.findOne({_id:ObjectId("5c25b504c32ea0b85da2a3bd")}, {"address":1})
db.address.find({_id:{$in:result["address"]}})
@jackyshan
jackyshan / promise.js
Created Dec 28, 2018
js实现promise,async,await
View promise.js
// async function helloAsync(){
// return "helloAsync";
// }
// console.log(helloAsync()) // Promise {<resolved>: "helloAsync"}
// helloAsync().then(v=>{
// console.log(v); // helloAsync
// })
@jackyshan
jackyshan / search.swift
Created Aug 20, 2018
Swift实现常用查找算法
View search.swift
//
// main.swift
// find
//
// Created by jackyshan on 2018/8/13.
// Copyright © 2018年 jackyshan. All rights reserved.
//
import Foundation
@jackyshan
jackyshan / sort.swift
Created Aug 10, 2018
Swift实现常用排序算法集合
View sort.swift
//
// main.swift
// SortDemo
//
// Created by jackyshan on 2018/8/7.
// Copyright © 2018年 GCI. All rights reserved.
//
import Foundation
View AndroidLostLuggage.java
package com.baitrading.bes.ui;
import android.os.Bundle;
import android.text.InputType;
import android.util.Log;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
View LostLuggage.swift
//
// DZLuggageGuardViewController.swift
// DianZiCheng
//
// Created by jackyshan on 2018/3/10.
// Copyright © 2018年 jackyshan. All rights reserved.
//
import UIKit
View GciSound.swift
import UIKit
import AudioToolbox
open class GciSound: NSObject {
fileprivate var mSoundId = kSystemSoundID_Vibrate
var mAction:() -> Void = {}
public init(SystemFile sysfile:String) {
super.init()
let path = "/System/Library/Audio/UISounds/\(sysfile).caf"
@jackyshan
jackyshan / CheckWselfHelper.swift
Created Jan 20, 2018
写个简单的Swift检测Controller没有销毁的工具
View CheckWselfHelper.swift
//
// CheckWselfHelper.swift
// alliance
//
// Created by jackyshan on 2018/1/19.
// Copyright © 2018年 GCI. All rights reserved.
//
import Foundation
View http_proxy.sh
给 iTerm 终端设置代理
1.设置代理
使用 curl,wget,brew等http应用程序会调用http_proxy和https_proxy这两环境变量进行代理,通过下面方式设置:
export http_proxy=http://127.0.0.1:8087
export https_proxy=$http_proxy
2.取消设置
unset http_proxy https_proxy
You can’t perform that action at this time.