Skip to content

Instantly share code, notes, and snippets.

View Baoyx007's full-sized avatar
💻
Focusing

Haven Baoyx007

💻
Focusing
  • Shanghai, China
View GitHub Profile
@Baoyx007
Baoyx007 / caret.js
Created November 6, 2019 08:42 — forked from islishude/caret.js
get/set caret position in contentEditable or textarea/input element(JavaScript)
/**
* @file get/set caret position and insert text
* @author islishude
* @license MIT
*/
export class Caret {
/**
* get/set caret position
* @param {HTMLColletion} target
*/
@Baoyx007
Baoyx007 / cloudSettings
Created August 29, 2017 03:01
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-08-29T03:01:35.469Z","extensionVersion":"v2.8.3"}
@Baoyx007
Baoyx007 / cloudSettings
Created June 8, 2017 09:10
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-06-08T09:10:56.517Z","extensionVersion":"v2.8.1"}
@Baoyx007
Baoyx007 / cloudSettings
Created June 6, 2017 04:39
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-06-06T04:39:36.197Z","extensionVersion":"v2.8.1"}
// yaml_to_toml.js
const readline = require('readline');
const fs = require('fs');
const os = require('os');
const moment = require('moment-timezone'); // 需要通过 npm install moment-timezone 来安装
const timezone = 'Asia/Shanghai'; // 时区
const src = './hexo'; // hexo .md 文件源目录
const target = './post'; // 目标文件目录
@Baoyx007
Baoyx007 / table
Created June 2, 2017 11:16
table expandable
<template>
<Table border :columns="columns7" :data="data6" @on-expand="expand"></Table>
</template>
<script>
import etable from '../components/table.vue';
export default {
components: { etable },
data () {
return {
columns7: [
➜ Homebrew git:(master) brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: Suspicious Homebrew/brew git origin remote found.
With a non-standard origin, Homebrew won't pull updates from
the main repository. The current git origin is:
https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
➜ Homebrew git:(master) brew config
HOMEBREW_VERSION: 1.2.0-86-g1e6cf8f270
ORIGIN: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
HEAD: 1e6cf8f27091ad5884357b9cbb17a68b77ce29fa
Last commit: 8 hours ago
Core tap ORIGIN: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-python.git
Core tap HEAD: 289c0a835136bca183028bad993c78363e428ccf
Core tap last commit: 4 months ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
function tco(f) {
var value;
var active = false;
var accumulated = [];
return function accumulator() {
accumulated.push(arguments);
if (!active) {
active = true;
@Baoyx007
Baoyx007 / ecnuAutoLogin.py
Created November 10, 2015 07:07
ecnu login
# -*- coding: utf-7 -*-
import requests
Login_url = 'http://10.9.27.18/include/auth_action.php'
def login():
username = 'xx'
password = 'xx'
login_data = {"username": username, "password": password, "action": 'login', 'ajax': '1', 'ac_id': '4'}