Skip to content

Instantly share code, notes, and snippets.

View kaelzhang's full-sized avatar
👻
♡╰̩̩̩̩̩̍̍●̩̩̩̩̩̩̩̻̍̍̍̍̍̍̍̊ᴗ̩̩̩̩̩̩̩̩̩̩̪̺̍̍̍̍̍̍̍̍̍̍̆̑●̩̩̩̩̩̩̩̻̍̍̍̍̍̍̍̊╯̩̩̩̩̩̍̍̍̍̍♡

Kael kaelzhang

👻
♡╰̩̩̩̩̩̍̍●̩̩̩̩̩̩̩̻̍̍̍̍̍̍̍̊ᴗ̩̩̩̩̩̩̩̩̩̩̪̺̍̍̍̍̍̍̍̍̍̍̆̑●̩̩̩̩̩̩̩̻̍̍̍̍̍̍̍̊╯̩̩̩̩̩̍̍̍̍̍♡
View GitHub Profile
@xhkyyy
xhkyyy / kubernetes-dubbo.md
Last active September 20, 2018 05:18
kubernetes dubbo 方案

kubernetes 下运行 dubbo 服务方案总结

目前 kubernetes 还没有提供“随机端口”的特性,所以实现起来比较麻烦。

下面前 2 种方案主要考虑的场景是 dubbo 运行在 kubernetes 集群中,但是也希望 kubernetes 集群“外”的应用也能使用这些 dubbo 服务。

实现原理:

  • dubbo 已经提供了 2 个环境变量: DUBBO_IP_TO_REGISTRY、DUBBO_PORT_TO_REGISTRY 分别表示服务注册到注册中心的 IP 和 PORT。
@smitshilu
smitshilu / Tensorflow_Build_GPU.md
Last active June 9, 2020 18:27
Tensorflow 1.4 Mac OS High Sierra 10.13 GPU Support

Tensorflow

System information

  • OS - High Sierra 10.13
  • Tensorflow - 1.4
  • Xcode command line tools - 8.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
  • Cmake - 3.7
  • Bazel - 0.7.0
@lars-tiede
lars-tiede / asyncio_loops.py
Last active April 3, 2024 15:28
asyncio + multithreading: one asyncio event loop per thread
import asyncio
import threading
import random
def thr(i):
# we need to create a new loop for the thread, and set it as the 'default'
# loop that will be returned by calls to asyncio.get_event_loop() from this
# thread.
loop = asyncio.new_event_loop()
@agentgt
agentgt / One Dark.icls
Last active January 8, 2019 07:03
Intellij Atom One Dark theme
<scheme name="One Dark" version="142" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="CONSOLE_FONT_NAME" value="Monospaced" />
<option name="EDITOR_FONT_NAME" value="Menlo" />
<colors>
<option name="ADDED_LINES_COLOR" value="abb2bf" />
<option name="ANNOTATIONS_COLOR" value="ffffff" />
<option name="ANNOTATIONS_MERGED_COLOR" value="ffffff" />
<option name="CARET_COLOR" value="61afef" />
@marklkelly
marklkelly / Dockerfile
Last active July 20, 2020 02:01
OpenResty + HTTP2 (patch) + ngx_pagespeed
FROM zokeber/centos:latest
MAINTAINER Mark Kelly <marklkelly@gmail.com>
RUN touch /var/lib/rpm/*
RUN yum install -y deltarpm; yum clean all
RUN yum install -y sudo; yum clean all
# Set versions. Check http://openresty.org for latest version and bundled version of nginx.
ENV OPENRESTY_VERSION 1.9.3.1
ENV NGINX_VERSION 1.9.3
@kevincennis
kevincennis / v8.md
Last active May 6, 2024 05:25
V8 Installation and d8 shell usage

Installing V8 on a Mac

Prerequisites

  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • $ nano ~/.zshrc
    • Add path=('/path/to/depot_tools' $path)
@hail2u
hail2u / cycle-metasyntactic-variables.vim
Created September 14, 2013 11:55
'foo', 'bar', 'baz', 'qux', 'quux', 'corge', 'grault', 'garply', 'waldo', 'fred', 'plugh', 'xyzzy', 'thud'の上で<C-a>/<C-x>すると順にサイクルしてくれるやつ。レジスター使ってる。
" Cycle metasyntactic variables
function! s:CycleMetasyntacticVariables(num)
if type(a:num) != type(0)
return
endif
let vars = ['foo', 'bar', 'baz', 'qux', 'quux', 'corge', 'grault', 'garply', 'waldo', 'fred', 'plugh', 'xyzzy', 'thud']
let cvar = expand('<cword>')
let i = index(vars, cvar)
@algal
algal / nginx-cors.conf
Created April 29, 2013 10:52
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests
@alexjs
alexjs / cors-nginx.conf
Created November 28, 2012 22:42 — forked from michiel/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#