Skip to content

Instantly share code, notes, and snippets.

View rupertqin's full-sized avatar

Rupert rupertqin

  • Shanghai
View GitHub Profile
#!/bin/bash
user=root
file=environment.js
if [[ $server == develop ]]; then
host=150.158.6.63
path=/data/ncbd/env
port=22
elif [[ $server == develop-test ]]; then
import extractd from "extractd";
import { readdir } from "node:fs/promises";
import { join } from "node:path";
(async () => {
const dir = "/Users/qx/Downloads/100MSDCF/";
let files = await readdir(dir);
files = files
.filter((file) => file.endsWith(".ARW"))
.map((file) => join(dir, file));
var $ = document.querySelectorAll.bind(document)
var $$ = document.querySelector.bind(document)
Element.prototype.on = Element.prototype.addEventListener;
NodeList.prototype.on = function (event, fn) {
[]['forEach'].call(this, function (el) {
el.on(event, fn);
});
return this;
};
@rupertqin
rupertqin / git_toturial
Last active February 2, 2016 02:08 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
@rupertqin
rupertqin / cities-latlng.js
Last active January 15, 2023 17:50
中国省市经纬度 JSON
var citiesLatLng = {
"municipalities": [
{
"name": "北京",
"g": {
"lng": "116.395645",
"lat": "39.929986"
}
},
{
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="leilei.css">
</head>
<body>
<div class="wrapper">
<header>
<div class="branding">
@rupertqin
rupertqin / qunit_intro.html
Last active December 10, 2015 15:08
http://qunitjs.com/intro/ jsfiddle for Q-unit introdution
<a href="http://jsfiddle.net/pxhRh/">Testing The DOM manipulation</a>
<a href="http://jsfiddle.net/ZPKr4/">Refactoring, Stage 2</a>
<a href="http://jsfiddle.net/XMDBp/">Back To The Start</a>
@rupertqin
rupertqin / detect.js
Created December 18, 2012 07:48
come from《JAVASCRIPT pro》
var sUserAgent = navigator.userAgent;
var fAppVersion = parseFloat(navigator.appVersion);
function compareVersions(sVersion1, sVersion2) {
var aVersion1 = sVersion1.split(".");
var aVersion2 = sVersion2.split(".");
if (aVersion1.length > aVersion2.length) {
for (var i=0; i < aVersion1.length - aVersion2.length; i++) {