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
public class MainWindow { | |
/// <summary> | |
/// 输入法的输入框被打开,已有文本在内 | |
/// </summary> | |
/// <returns>若有文本正在输入则为 true,否则为 false</returns> | |
private bool IsImeCompositionWindowOpened() { | |
var helper = new WindowInteropHelper(this); | |
var hImc = NativeMethods.ImmGetContext(helper.Handle); | |
const int readType = NativeMethods.GCS_COMPSTR; | |
try { |
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
public class MainWindow { | |
private short atom; | |
private HwndSource hwndSource; | |
public MainWindow { | |
this.Loaded += (sender, args) => { | |
// 挂载全局快捷键 | |
var helper = new WindowInteropHelper(this); | |
hwndSource = HwndSource.FromHwnd(helper.Handle); | |
if(hwndSource != null) |
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
function getUrlParameter(sParam) { | |
var sPageURL = decodeURIComponent(window.location.search.substring(1)), | |
sURLVariables = sPageURL.split('&'), | |
sParameterName | |
for (var i = 0; i < sURLVariables.length; i++) { | |
sParameterName = sURLVariables[i].split('=') | |
if (sParameterName[0] === sParam) { | |
return sParameterName[1] === undefined ? true : sParameterName[1] | |
} |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fiddler2] | |
"BlockUpdateCheck"="True" |
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: node:6-alpine | |
cache: | |
key: "$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME" | |
paths: | |
- node_modules/ | |
- yarn_cache/ | |
stages: | |
- setup |
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: maven:3.3-jdk-8-alpine | |
cache: | |
key: "$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME" | |
paths: | |
- .m2/ | |
variables: | |
MAVEN_OPTS: "-Dmaven.repo.local=.m2" |
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
#!/bin/bash | |
# This script cleans up your EC2 instance before baking a new AMI. | |
# Run the following command in a root shell: | |
# | |
# wget -qO- https://gist.github.com/zerda/677b279f2b8888ed92c4c614790fe232/raw/ami-clean.sh | bash | |
function print_green { | |
echo -e "\e[32m${1}\e[0m" | |
} |
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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: elasticsearch-logging | |
namespace: kube-system | |
labels: | |
k8s-app: elasticsearch-logging | |
spec: | |
replicas: 1 | |
template: |
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
FROM nginx:alpine | |
EXPOSE 80 | |
RUN apk add --update --no-cache jq | |
ADD ./docker-entrypoint.sh / | |
ADD ./config.json ./index.html /usr/share/nginx/html/ | |
ENV CONFIG_PATH=/usr/share/nginx/html/config.json | |
ENTRYPOINT ["/docker-entrypoint.sh"] | |
CMD ["nginx", "-g", "daemon off;"] |
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
# Check for interactive bash and that we haven't already been sourced. | |
if [ -n "${BASH_VERSION-}" -a -n "${PS1-}" -a -z "${BASH_COMPLETION_COMPAT_DIR-}" ]; then | |
# Check for recent enough version of bash. | |
if [ ${BASH_VERSINFO[0]} -gt 4 ] || \ | |
[ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then | |
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \ | |
. "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" | |
if shopt -q progcomp && [ -r /usr/share/bash-completion/bash_completion ]; then | |
# Source completion code. |
OlderNewer