Skip to content

Instantly share code, notes, and snippets.

View JonasGao's full-sized avatar
🙂
Cured ! Thanks God

Jonas Gao JonasGao

🙂
Cured ! Thanks God
  • Earth
  • Big Data
View GitHub Profile
@JonasGao
JonasGao / shadow.css
Created October 22, 2019 04:15
Material shadow example
.material:hover {
box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0,0,0,.12)
}
.material {
box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0,0,0,.12)
}
@JonasGao
JonasGao / Get-FontName.ps1
Last active November 24, 2019 01:35
Get font title by powershell
$path = 'A:\segoescb.ttf'
$folder = Split-Path $path
$file = Split-Path $path -Leaf
$shell = New-Object -COMObject Shell.Application
$shellfolder = $shell.Namespace($folder)
$shellfile = $shellfolder.ParseName($file)
## get (localized) description and value of
## specified extended attributes numbers
@JonasGao
JonasGao / Rename-GitRepo.ps1
Last active November 24, 2019 04:20
Move git repo to path like remote path
[CmdletBinding()]
param(
[string]$Target,
[string]$Base = "$HOME"
)
function Move-GitRepo() {
[CmdletBinding()]
param(
[System.IO.DirectoryInfo]$Target,
@JonasGao
JonasGao / New-DataLink.ps1
Last active November 24, 2019 03:32
New link data to new version vscode, and make target vscode to current use
@JonasGao
JonasGao / find-git-repo.sh
Created November 10, 2019 08:54
find git repo
#!/bin/bash
find ${1} -type d -maxdepth ${2} | while read line; do
git_dir="${line}/.git"
if [[ -d ${git_dir} ]]; then
echo $line
fi
done
@JonasGao
JonasGao / move-git-repo
Created November 10, 2019 08:54
move git repo
#!/bin/bash
shopt -s extglob
cwd=$(pwd)
target=${1}
ls ${target} | while read dirname; do
gitRepo="${target}/${dirname}"
gitDir="${gitRepo}/.git"
param(
[string]$Target
)
Get-ChildItem $Target -Directory | ForEach-Object {
$gitDir = ("{0}\.git" -f $_.FullName)
if (Test-Path $gitDir -PathType Container) {
Push-Location $_
Write-Output ("{0} -> {1}" -f $_.FullName, (git config --get remote.origin.url))
Pop-Location
@JonasGao
JonasGao / init_centos_docker_user.sh
Last active March 11, 2020 08:13
Setup docker environment
#!/bin/bash
title() {
printf "\n\n==== $1 ====\n\n"
}
title "useradd docker"
useradd docker
title "passwd docker"
# https://youtrack.jetbrains.com/issue/IDEA-228656
netsh int ipv4 add excludedportrange tcp 6949 50 persistent
@JonasGao
JonasGao / test_set.java
Last active August 30, 2023 04:49
Test the same object add to set
public static void main(String[] args) {
SomeClass1 a1 = new SomeClass1();
a1.setName("A");
SomeClass1 a2 = new SomeClass1();
a2.setName("A");
SomeClass1 b = new SomeClass1();
b.setName("B");
SomeClass1 c = new SomeClass1();
c.setName("C");