cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=http://yum.kubernetes.io/repos/kubernetes-el7-x86_64
This file contains 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
function convert_to_utc (today){ | |
var localoffset = -(today.getTimezoneOffset()/60); | |
//var destoffset = -4; | |
//var offset = destoffset-localoffset; | |
var offset = localoffset; | |
var d = new Date( today.getTime() + offset * 3600 * 1000); | |
return d; | |
} | |
This file contains 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
'use strict'; | |
var crypto = require('crypto'); | |
/** | |
* generates random string of characters i.e salt | |
* @function | |
* @param {number} length - Length of the random string. | |
*/ | |
var genRandomString = function(length){ | |
return crypto.randomBytes(Math.ceil(length/2)) |
This file contains 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
/* Polyfill indexOf. */ | |
var indexOf; | |
if (typeof Array.prototype.indexOf === 'function') { | |
indexOf = function (haystack, needle) { | |
return haystack.indexOf(needle); | |
}; | |
} else { | |
indexOf = function (haystack, needle) { | |
var i = 0, length = haystack.length, idx = -1, found = false; |
This file contains 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
# https://github.com/kennethreitz/requests/blob/master/requests/exceptions.py | |
class RequestException(IOError): | |
"""There was an ambiguous exception that occurred while handling your | |
request. | |
""" | |
def __init__(self, *args, **kwargs): | |
"""Initialize RequestException with `request` and `response` objects.""" | |
response = kwargs.pop('response', None) | |
self.response = response |
This file contains 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
""" | |
requests.structures | |
~~~~~~~~~~~~~~~~~~~ | |
Data structures that power Requests. | |
""" | |
from .compat import OrderedDict, Mapping, MutableMapping | |
class CaseInsensitiveDict(MutableMapping): |
This file contains 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
package main | |
import ( | |
"fmt" | |
"io" | |
"io/ioutil" | |
"net/url" | |
"github.com/benburkert/http" | |
//"net/http" |
This file contains 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
//https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-ui/src/util/bus.js | |
import Vue from 'vue' | |
const bus = new Vue() | |
export default { | |
install (Vue) { | |
Vue.prototype.$bus = (type, ...args) => { | |
bus.$emit(type, ...args) | |
} |
This file contains 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
/* | |
* to.matched is array for all the route it matches, use m.meta to get flags | |
* remember to use next() at the end ! | |
* next({name: 'new-route'}) to redirect | |
*/ | |
router.beforeEach(async (to, from, next) => { | |
if (to.matched.some(m => m.meta.needProject)) { | |
const result = await apolloClient.query({ | |
query: PROJECT_CURRENT, |
This file contains 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
console.log('%cAn error occured', 'background: red; color: white; padding: 4px; border-radius: 4px;font-weight: bold;') | |
console.log("%cStr1" + "%cStr2", "Css-for-str1", "Css-for-str2") |
OlderNewer