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
| ;; change default defvar | |
| ;; use advice and setq to change defvar in function. | |
| (defun my-use-zsh-as-default-shell () | |
| (setq my-term-program "/bin/zsh")) | |
| (advice-add 'my-switch-to-shell :before #'my-use-zsh-as-default-shell) |
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
| brew tap-new uname/old-openssl | |
| brew extract --version=1.0.2t openssl uname/old-openssl | |
| brew install openssl@1.0.2t | |
| cd /usr/local/opt/ | |
| ln -snf ../Cellar/openssl@1.0.2t/1.0.2t openssl |
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
| task installGitHooks(type: Copy) { | |
| from 'pre-push' | |
| into '.git/hooks' | |
| fileMode 0744 | |
| } | |
| defaultTasks 'installGitHooks' |
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
| kubectl -n kube-system describe secret $( | |
| kubectl -n kube-system get secret | \ | |
| awk '/^deployment-controller-token-/{print $1}' | |
| ) | \ | |
| awk '$1=="token:"{print $2}' |
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
| version: '3.1' | |
| services: | |
| redis: | |
| image: redis | |
| command: redis-server --requirepass yourpassword | |
| ports: | |
| - "6379:6379" | |
| volumes: | |
| - ./data/redis:/data |
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
| buildscript { | |
| ext { | |
| springBootVersion = '2.1.4.RELEASE' | |
| aspectjVersion = '1.8.13' | |
| } | |
| repositories { | |
| mavenLocal() | |
| maven { | |
| url "https://s3-eu-west-1.amazonaws.com/gskillz-maven-repo" | |
| } |
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
| println(Some(null) == None) // false | |
| println(Option(null) == None) // true | |
| println(Option(null).exists(_.toLowerCase == "true")) // compile error | |
| val m = Map.empty + ("" -> "") + ("1" -> null) | |
| println(m.get("1").exists(_.toLowerCase == "true")) // java.lang.NullPointerException | |
| /////// | |
| println(Option("true").exists(a => a == "true" || a == "TRUE")) // true | |
| println(Option("false").exists(a => a == "true" || a == "TRUE")) // false | |
| println(Option(null).exists(a => a == "true" || a == "TRUE")) // false |
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
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>ggggg</groupId> | |
| <artifactId>aaaaa</artifactId> | |
| <version>2.0.0-SNAPSHOT</version> | |
| <packaging>jar</packaging> | |
| <name>nnn</name> | |
| <properties> | |
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
| <spark.version>1.6.3</spark.version> |
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
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.InputStreamReader; | |
| /** | |
| * 获取配置文件 | |
| * Created by yingrong on 2017/7/27. | |
| */ | |
| public class Resource { |
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
| { | |
| "size": 0, | |
| "aggs": { | |
| "dp": { | |
| "date_histogram": { | |
| "field": "@timestamp", | |
| "interval": "hour", | |
| "format": "yyyy-MM-dd HH" | |
| }, | |
| "aggs": { |
NewerOlder