Skip to content

Instantly share code, notes, and snippets.

View Kairo-Dai's full-sized avatar
:octocat:
Out sick

dai Kairo-Dai

:octocat:
Out sick
View GitHub Profile
@Kairo-Dai
Kairo-Dai / 始终编译visual studio中的项目.xml
Last active August 18, 2020 01:38
始终编译visual studio中的项目
<PropertyGroup>
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>
旧方法
set(_THIS_MODULE_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
function(foo)
configure_file(
"${_THIS_MODULE_BASE_DIR}/some.template.in"
some.output
)
endfunction()
@Kairo-Dai
Kairo-Dai / cmake的测试表达式.cmake
Last active August 28, 2020 07:20
cmake测试表达式
add_custom_command(TARGET ${LIBNAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPS_DIR}/ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug>/FolderName
)
如下测试表达式的结果是:somethingtext
#$<1:somethingtext>
@Kairo-Dai
Kairo-Dai / Groovy Goodness: Working with Lines in Strings.txt
Created August 28, 2020 07:18
Groovy Goodness: Working with Lines in Strings.txt
def multiline = '''\
Groovy is closely related to Java,
so it is quite easy to make a transition.
'''
// eachLine takes a closure with one argument, that
// contains the complete line.
multiline.eachLine {
if (it =~ /Groovy/) {
println it // Output: Groovy is closely related to Java,
@Kairo-Dai
Kairo-Dai / jenkinsfile获取最后一行.txt
Last active August 28, 2020 07:23
Jenkinsfile获取最后一行
def mystr = """
asf
asdf
asdfasdf
1123
sssssss
"""
mystr.tokenize().last()
@Kairo-Dai
Kairo-Dai / vcruntime slient install.md
Last active September 2, 2020 09:35
vcruntime slient install

Visual C++ 2015, 2017, 2019 Redistributable Silent Install

Note: Visual C++ 2015, 2017 and 2019 all share the same redistributable files. Microsoft Visual C++ 2015-2019 x86 Redistributable Silent Install

Download Visual C++ 2015-2019 x86 Redistributable
    https://aka.ms/vs/16/release/vc_redist.x86.exe
Download the file to a folder created at (C:\Downloads)
Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator

Navigate to the C:\Downloads folder

@Kairo-Dai
Kairo-Dai / delete cygwin on windows.txt
Created September 3, 2020 03:43
delete cygwin on windows
takeown /f "c:\cygwin" /r /d Y
icacls "c:\cygwin" /T /Q /C /reset
rd "c:\cygwin" /s /q
@Kairo-Dai
Kairo-Dai / gcc show predefine.txt
Last active September 18, 2020 11:56
打印GCC的预定义宏
touch foo.h | gcc -E -dM foo.h > foo.h
touch foo.h | g++ -E -dM -std=c++14 foo.h > foo.h
@Kairo-Dai
Kairo-Dai / Microsoft.PowerShell_profile.ps1
Created September 13, 2020 10:36
powershell命令行http代理
# Set-Proxy command
Function SetProxy() {
Param(
$Addr = $null,
[switch]$ApplyToSystem
)
$env:HTTP_PROXY = $Addr;
$env:HTTPS_PROXY = $Addr;
$env:http_proxy = $Addr;