Skip to content

Instantly share code, notes, and snippets.

@OneYX
OneYX / 0_reuse_code.js
Created April 7, 2016 17:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@OneYX
OneYX / setParmsValue.js
Created April 26, 2016 07:25 — forked from simplelife7/setParmsValue.js
【JS】URL参数活动、设置
//设置URL参数的方法
function setParmsValue(parms, parmsValue) {
var urlstrings = document.URL;
var args = GetUrlParms();
var values = args[parms];
//如果参数不存在,则添加参数
if (values == undefined) {
var query = location.search.substring(1); //获取查询串
//如果Url中已经有参数,则附加参数
if (query) {
@OneYX
OneYX / mirrorlist.mingw32
Created August 28, 2017 02:54 — forked from elvisw/mirrorlist.mingw32
MSYS2国内源
##
## 32-bit Mingw-w64 repository mirrorlist
## Changed on 2014-11-15
##
##中国科学技术大学开源软件镜像
Server = http://mirrors.ustc.edu.cn/msys2/REPOS/MINGW/i686
##北京理工大学镜像
Server = http://mirror.bit.edu.cn/msys2/REPOS/MINGW/i686
##日本北陆先端科学技术大学院大学 sourceforge 镜像
Server = http://jaist.dl.sourceforge.net/project/msys2/REPOS/MINGW/i686
@OneYX
OneYX / chatbot.md
Created September 30, 2017 07:41 — forked from yangshaoshun/chatbot.md
智能聊天机器人二次开发 选型
@OneYX
OneYX / date.prototype.format.js
Created December 7, 2017 11:48 — forked from binjoo/date.prototype.format.js
JAVASCRIPT:时间格式化
/**
* 对Date的扩展,将 Date 转化为指定格式的String
* 月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q) 可以用 1-2 个占位符
* 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
* eg:
* (new Date()).pattern("yyyy-MM-dd hh:mm:ss.S") ==> 2007-07-02 08:09:04.423
* (new Date()).pattern("yyyy-MM-dd E HH:mm:ss") ==> 2007-03-10 二 20:09:04
* (new Date()).pattern("yyyy-MM-dd EE hh:mm:ss") ==> 2007-03-10 周二 08:09:04
* (new Date()).pattern("yyyy-MM-dd EEE hh:mm:ss") ==> 2007-03-10 星期二 08:09:04
* (new Date()).pattern("yyyy-M-d h:m:s.S") ==> 2007-7-2 8:9:4.18
@OneYX
OneYX / A.markdown
Created December 27, 2017 01:49 — forked from larrybotha/A.markdown
Merge wiki updates that are on a fork of your repo.

Merge Wiki Changes From A Forked Github Repo

This is inspired (or basically copied) from How To Merge Github Wiki Changes From One Repository To Another, by Roman Ivanov, and serves to ensure that should something happen to the original article, the information remains nice and safe here.

Terminology

OREPO: original repo - the repo created or maintained by the owner

FREPO: the forked repo that presumably has updates to its wiki, not yet on the OREPO

@OneYX
OneYX / install-java-8-on-ubuntu-14.04-auto-accept-licence-agreement.sh Install oracle Java 8 on Ubuntu 14.04 and automatically accept the licence agreement. 100% hands-free install.
#! /bin/bash
sudo apt-get update
sudo apt-get install -y software-properties-common debconf-utils
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
sudo echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
sudo apt-get install -y oracle-java8-installer
@OneYX
OneYX / trial.key
Created April 13, 2018 05:44 — forked from huqi/trial.key
Beyond Compare 4 license for Mac
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
@OneYX
OneYX / object-to-form-data.js
Created July 10, 2018 11:56 — forked from ghinda/object-to-form-data.js
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
// takes a {} object and returns a FormData object
var objectToFormData = function(obj, form, namespace) {
var fd = form || new FormData();
var formKey;
for(var property in obj) {
if(obj.hasOwnProperty(property)) {
if(namespace) {
@OneYX
OneYX / nginx-location
Created August 9, 2018 09:50 — forked from luxixing/nginx-location
nginx location 匹配规则
1 普通匹配,遵循最长匹配规则,假设一个请求匹配到了两个普通规则,则选择匹配长度大的那个
例如:
location /{
[matches]
}
location /test{
[matches]
}
2 精确匹配
location = /{