This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://shifei.me/index.php/archives/10/ | |
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| "net/url" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| *beforeSendResponse(req, res) { | |
| let { response } = res; | |
| const { body } = response; | |
| let document = body.toString(); | |
| response.body = new Buffer(document); | |
| return { response }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Detect if the browser is running in Private Browsing mode | |
| * | |
| * @export | |
| * @returns {Promise} | |
| */ | |
| export default function isPrivateMode() { | |
| return new Promise((resolve) => { | |
| const on = () => resolve(true); // is in private mode | |
| const off = () => resolve(false); // not private mode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script id="jsbin-javascript"> | |
| let r = document.getElementsByTagName('script')[0]; | |
| // console.log(r); | |
| function getNested (theObject, path, defaultValue) { | |
| try { | |
| separator = '.'; | |
| return path. | |
| replace('[', separator).replace(']',''). | |
| split(separator). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #用户名 | |
| #rpc-user=user | |
| #密码 | |
| #rpc-passwd=passwd | |
| #上面的认证方式不建议使用,建议使用下面的token方式 | |
| #设置加密的密钥 | |
| #rpc-secret=token | |
| #允许rpc | |
| enable-rpc=true | |
| #允许所有来源, web界面跨域权限需要 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| image: golang:1.8-alpine # The alpine builds are much smaller but lack tools we need, we'll add them later | |
| stages: | |
| - build | |
| - test | |
| before_script: | |
| - apk --update --upgrade add git curl-dev openssh curl ca-certificates # This is how we add system dependencies. | |
| # You may need less or more packages for your app. | |
| - curl -sS https://glide.sh/get | sh | |
| - mkdir -p /go/src/gitlab.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export PATH="$HOME/.rbenv/bin:$HOME/.ndenv/bin:$HOME/.jenv/bin:$HOME/.pyenv/bin:$PATH" | |
| export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles | |
| export SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ | |
| export PHANTOMJS_CDNURL=https://npm.taobao.org/dist/phantomjs | |
| export ANDROID_HOME=/usr/local/Cellar/android-sdk | |
| eval "$(rbenv init -)" | |
| eval "$(ndenv init -)" | |
| eval "$(jenv init -)" | |
| eval "$(pyenv init -)" | |
| eval "$(pyenv virtualenv-init -)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <settings> | |
| <mirrors> | |
| <mirror> | |
| <id>aliyun</id> | |
| <mirrorOf>*,!sonar</mirrorOf> | |
| <url>http://maven.aliyun.com/nexus/content/groups/public</url> | |
| </mirror> | |
| </mirrors> | |
| </settings> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python2 | |
| # -*- coding:utf-8 -*- | |
| from __future__ import print_function, division, unicode_literals | |
| from udevedu.utils import invoke | |
| def init(): | |
| print("Monitor Yubikey NEO") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| settings = { | |
| 'test': { | |
| 'path': '/home/shirou/ansible/test/', | |
| 'inventory': 'inventory' | |
| } | |
| } | |
| module.exports = (robot) -> |