Skip to content

Instantly share code, notes, and snippets.

@mfyuce
mfyuce / makeWindowsFolderCaseSensitive.ps1
Created September 24, 2020 11:14
Make Windows Folder Case Sensitive (as in Linux)
param (
[Parameter(Mandatory=$true)][string]$dir = "."
)
fsutil.exe file setCaseSensitiveInfo "$($dir)" enable
# Create an array of folders
$folders = Get-ChildItem -Path $dir -Recurse -Directory -Force -ErrorAction SilentlyContinue
# Perform iteration to create the same file in each folder
@mfyuce
mfyuce / python_and_java_logical_and
Created December 11, 2018 11:50
Check whether java's `&&` and pythons `and` is the same thing;
def true():
print("True")
return True
def false():
print("False")
return False
true() and false()
@mfyuce
mfyuce / dependencies_as_hierarchy.groovy
Created December 11, 2018 06:12
Gradle Dependencies as Tree list
task printSolvedDepsTreeInJson {
doLast {
def jsonOutput = "["
configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each { dep ->
def addToJson
addToJson = { resolvedDep ->
jsonOutput += "\n{"
jsonOutput += "\"groupId\":\"${resolvedDep.module.id.group}\"," +
"\"artifactId\":\"${resolvedDep.module.id.name}\"," +
#!/bin/sh
if [ -z "$1" ]; then
echo "$0 <vm name>"
exit -1
fi
docker-machine ssh $1 -- tce-load -wi python.tcz
docker-machine ssh $1 -- sudo ln -s /usr/local/bin/python /usr/bin/python
docker-machine ssh $1 -- 'curl https://bootstrap.pypa.io/get-pip.py | sudo python -'
docker-machine ssh $1 -- sudo pip install docker-py