Skip to content

Instantly share code, notes, and snippets.

@bronze1man
bronze1man / git-submodule-rm.sh
Created September 27, 2012 08:35 — forked from barraponto/git-submodule-rm.sh
git submodule-rm
#!/bin/bash
function actual_path() {
if [ [ -z "$1" ] -a [ -d $1 ] ]; then
echo $(cd $1 && test `pwd` = `pwd -P`)
return 0
else
return 1
fi
}
@bronze1man
bronze1man / gist:9050632
Created February 17, 2014 13:39
go-lang-idea-plugin StackOverflowError
null
java.lang.StackOverflowError
at com.intellij.openapi.application.impl.ApplicationImpl.isReadAccessAllowed(ApplicationImpl.java:1055)
at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1024)
at com.intellij.psi.impl.source.tree.CompositeElement.textToCharArray(CompositeElement.java:282)
at com.intellij.psi.impl.source.tree.CompositeElement.getText(CompositeElement.java:253)
at com.intellij.extapi.psi.ASTDelegatePsiElement.getText(ASTDelegatePsiElement.java:133)
at ro.redeul.google.go.lang.psi.impl.toplevel.GoTypeNameDeclarationImpl.getName(GoTypeNameDeclarationImpl.java:48)
at ro.redeul.google.go.lang.psi.resolve.TypeNameResolver.checkReference(TypeNameResolver.java:38)
at ro.redeul.google.go.lang.psi.resolve.TypeNameResolver.visitTypeSpec(TypeNameResolver.java:24)
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"code.google.com/p/go.crypto/ssh"
"crypto"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"fmt"
@bronze1man
bronze1man / android-studio复原.md
Last active September 26, 2015 07:12
git拉取到的android studio项目,在androidstudio里面可以打版本

选择 File->New->Import Files... 然后选择android项目根目录.

image

@bronze1man
bronze1man / winDivert-md5.json
Last active May 20, 2019 05:41
md5 of all pre-built winDivert dll sys exe
{
"007a3ae3f03fb18c2cab1e0c97c45a20": [
"WinDivert-1.4.0-rc-A-MINGW.zip/WinDivert-1.4.0-rc-A-MINGW/x86_64/WinDivert64.sys",
"WinDivert-1.4.0-rc-A-MINGW.zip/WinDivert-1.4.0-rc-A-MINGW/x86/WinDivert64.sys",
"WinDivert-1.4.0-rc-A-WDDK.zip/WinDivert-1.4.0-rc-A-WDDK/x86_64/WinDivert64.sys",
"WinDivert-1.4.0-rc-A-WDDK.zip/WinDivert-1.4.0-rc-A-WDDK/x86/WinDivert64.sys",
"WinDivert-1.4.1-A-MINGW.zip/WinDivert-1.4.1-A-MINGW/x86_64/WinDivert64.sys",
"WinDivert-1.4.1-A-MINGW.zip/WinDivert-1.4.1-A-MINGW/x86/WinDivert64.sys",
"WinDivert-1.4.1-A-WDDK.zip/WinDivert-1.4.1-A-WDDK/x86_64/WinDivert64.sys",
"WinDivert-1.4.1-A-WDDK.zip/WinDivert-1.4.1-A-WDDK/x86/WinDivert64.sys",
@bronze1man
bronze1man / AesCtr.cs
Last active July 24, 2024 08:59
c# aes ctr implement works on vs2017/uwp , seen testRun for usage example.
using System.Security.Cryptography;
using System.Diagnostics;
using System;
using System.Runtime.InteropServices.WindowsRuntime;
namespace abc {
public sealed class AesCtr {
public static void testRun() {
for (var i2 = 0; i2 < 3; i2++) {
var outputV = Encrypt(new byte[32], new byte[16], new byte[30]);
@bronze1man
bronze1man / 0main.md
Last active January 18, 2023 02:46
Semantic Versioning 2.0.0 compare , valid , invalid example
@bronze1man
bronze1man / gist:cd6d4cbd9cc60dc7a6d285bf29047310
Created November 1, 2023 01:00
text that can show outside the TextField
ḻ͔̦͎̯͍̦͕̊̅ͦ͛͂̍͐̑̔͛̚̕͘k̨͎̳͈̫̫̤̙̪̞̦̳͙̭͓̜̙̞̄̽̊͐̍̓̋͊̎͘ͅa̩̮̘̗͈͙̠̲̠̹̹͚̣̜͖̳̞͇͂͊͒̈́̽̏ͮ̑́̉̾ͣ̽͆̀͘͟͢j̧̛͕̻̻̯̤̹̮̤ͬ̿ͮ͌̔ͧͤ͌ͤͭ͆ͤ̍͜͡fͭͨ̓͋̊҉̸̡̡̮̪͉̣͉̣͇͖̪͖̲͚l͌̎̑ͣͣ̏̀̈́̄͏̶̷̧͇̻̱̰́k̛̯̝͔̰̬̱͔̲̠̤̠̝͚͎͉ͭ͑ͫ̆̉̓;̷̸̨̀͒̏̃ͦ̈́̾̀́̎͢҉͚̼͉s̵͖̺̥͔͇̰̹̮͙͉̻̼̭̻͕̮͇ͨͬͪ͗̇̑̽͋̀j̶̋̊͌ͧͨͭ̓̅͐ͥ̂̔̊ͧ͊҉̶̵̞̩̦̳̺̳̬a̷̬̩̣̫͇̯̥ͯ̽͌̔ͪͯ́́͠l͖͍͕̠̦̼̗͋̍ͨ͘͜k̿̿̎͒ͤ̓̅̀͂ͧ͋̏ͫͣ̔͏̶̥̺͓̘̺͘ḑ̵͎̜̥͕͈̝̫͎̺̮̱̤̠̠͖̳ͮͧͫ͂͒ͤͣ̌̽ͨͪ͒̚͘͘͟j̸̧̻̥̣̪͍͕͇̮͙̹̪̄̄̉̒̊ͩ̅͆̚͟͝ͅf͈̼̩̯̒̎̇̆͆ͪ̈́͛̉̍̏́̄̈́̽̔̍̎̂͘͠n̸̸̡̛̪͕̯̫̹̥͔͚͙̦̩ͬ̆͗͌̔ͫ͆̀́͑̈́ͤ́ͯ̇ͧ͞s̶͚̭̥͉̰̝̺͍̭̤̹̘̮̪͖͖͉̲̾͂̐̋̉̊ͦͥ͘͢a̸̛̯͕̜̭̙̺̬̘ͫͧ͆ͨ͘͟͝ͅͅj̢͉̻͍̝̦͖̣̽̒̃͊̒̎͊̇͝͝ͅd̜͖̱͚̞̞̝̝̭̖͕͓͕͇̖̜̽̓̒ͬ̐̈́̀́́ṋ̠͖̼̯̼̍̈́̆̉ͭͪ̾ͭ̈́͛͑̽͐ͬ̈ͧ̕͟͝f̶̠̹͔̲͔̟͕̱̘̹̗͙̪̥̳͓ͧ̍̐̑̓ͥ̔̾͐́̎̎͛ͮ͑ͤ̃̉͟j̳͖̞ͦ̍͒ͩ̃̌̎͗͜j̡̻͉͈̮̯̲̘̱̱̞̜̖̞̣̱̈́̐̉͐͐͌̄̀̓͆͡ả̌̎͂ͨͩͬ̾̊͋ͪ̎̑̀͏͏̡̛̙̣͉̪̬̗̳̱̤̥s̡̪̮̮̟̥̠͚̼͉̥ͯ̓̂́͐̄̉̇ͣ́̚͜͟k̴̢ͪ̅̈̃̂ͯͭ͠͏̵͇̺͇̮̳̖̣͓̫̹͍͓͚͎̣͎͇;̨̡͇̲͙̞̺̪̯̯̗̯̯͔͖͖̞̤͗̊͐̋ͭ̇̒̔͐́̀f̵̛̹̩͍̹̼͚̯̞̤͔̟̦̱̯̃͆̾̑́͝ḑ̡̖̝͈̯̘͈̱̬̣̝͈͔͕͓̳̱̗̙̃͒̇ͪ̄ͥ̋̈ͬ̌͞ͅl̢͈̣̯̯̯̘̩̹̱̣̣ͦ̂ͣ̅̒ͪͤͮ͛͜j̛͆̃͗̑ͩ̏ͮ̋͐̾̆ͫͧ͌̓͏͡͏̸̩̻͇̙͎̞̭̪͚̩͖̪͔͓̰̣̳̰l͛ͯ̚
@bronze1man
bronze1man / isSoftInputVisible.kt
Last active November 30, 2023 13:47
Detecting if the Android keyboard is visible or hidden without @composable
// copy and change from https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/src/main/java/com/blankj/utilcode/util/KeyboardUtils.java#L185C1-L207C6
private var sDecorViewDelta = 0
fun isSoftInputVisible(activity: Activity): Boolean {
val window = activity.window
val decorView = window.decorView
val outRect = Rect()
decorView.getWindowVisibleDisplayFrame(outRect)
val delta = Math.abs(decorView.bottom - outRect.bottom)
var NavBarHeight = 0
val res = activity.application.resources
@bronze1man
bronze1man / isSoftInputVisibleInComposable.kt
Created November 30, 2023 13:39
Detecting if the Android keyboard is visible or hidden with @composable
@Composable
fun isSoftInputVisibleInComposable():Boolean{
@OptIn(ExperimentalLayoutApi::class)
return WindowInsets.isImeVisible
}