Skip to content

Instantly share code, notes, and snippets.

View qrtt1's full-sized avatar
🎯
Focusing

Ching Yi, Chan qrtt1

🎯
Focusing
View GitHub Profile
@qrtt1
qrtt1 / 00-ITHOME 2021 鐵人賽-觀戰區.md
Last active August 2, 2024 14:39
ITHome 第 13 屆鐵人賽 (updated UTC 2021-11-07 10:14:45.317902)
@qrtt1
qrtt1 / 000_2020-12th-ironman.md
Last active September 3, 2023 07:16
ITHome 第 12 屆鐵人賽 (updated UTC 2020-10-19 00:40:39.204524)
import collections
import re
import urllib
from urllib.request import Request
_s1 = r"""
curl 'https://irs.thsrc.com.tw/IMINT/captImg/foobar.jpg' \
-H 'Connection: keep-alive' \
-H 'Pragma: no-cache' \
-H 'Cache-Control: no-cache' \

Kotlin 讀書會 - CH 13 :: Initialization

接續著第 12 章,講解如何使用 class 關鍵字定義類別,在第 13 章專注在初始化的問題。

關鍵字

  • class header (n)
  • initialization (n)
    • everything required to make a variable, property, or class instance ready to use
  • creating an instance of a class
task copyDepends {
doLast {
configurations.implementation.canBeResolved = true
configurations.implementation.each {
def suffix = it.absolutePath.split("/")[-5..-1]
def (group, artifact, version) = suffix[-5..-3]
def basePath = (it.absolutePath - suffix.join("/")) + suffix[-5..-3].join("/")
copy {
from fileTree(basePath).files
into "build/localMavenRepo/$group/$artifact/$version"
qty:glab qrtt1$ cat ab
qty:glab qrtt1$ cat build.gradle
task abc {
  doLast {
      for (StackTraceElement e : Thread.currentThread().getStackTrace()) {
          System.out.println(e);

      }
  }
@qrtt1
qrtt1 / install.md
Created June 1, 2017 16:23 — forked from hlb/Brewfile
clean install

System Preferences

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
defaults write NSGlobalDomain InitialKeyRepeat -int 12

# Set a blazingly fast keyboard repeat rate
@qrtt1
qrtt1 / versioning_copy.py
Created October 18, 2016 17:36
ansible module for versioning_copy
#!/usr/bin/python
DOCUMENTATION = '''
---
module: versioning_copy
short_description: Copies the file with datetime versioning name
description:
- The versioning_copy module copies a file on remote locations. It designed for the tomcat's parallel deploy feature
options:
war:
qty:SAMPLE qrtt1$ for i in `find . -name "*.jar"`; do echo $i; unzip -l $i |grep 'org/apache/commons/logging/Log.class'; done
./build_SAMPLE/WEB-INF/lib/activation-1.1.jar
./build_SAMPLE/WEB-INF/lib/activation.jar
./build_SAMPLE/WEB-INF/lib/aws-java-sdk-1.6.3.jar
./build_SAMPLE/WEB-INF/lib/awsutils-1.7.17.jar
./build_SAMPLE/WEB-INF/lib/axis-1.4.jar
./build_SAMPLE/WEB-INF/lib/axis-jaxrpc-1.4.jar
./build_SAMPLE/WEB-INF/lib/axis-saaj-1.4.jar
./build_SAMPLE/WEB-INF/lib/axis-wsdl4j-1.5.1.jar
./build_SAMPLE/WEB-INF/lib/AzureStorageUtils.jar