This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Twitter_Snowflake加长使用年限Java版 | |
| * <pre> | |
| * 此版本在原版的基础上将10位数据机器位分一半增加到时间戳位组成46位时间戳数据位。 | |
| * 相对原版来说优点是延长使用时间到2000多年,缺点是最大只能部署32个节点,适合访问量不大的系统。 | |
| * 修改后的结构如下(每部分用-分开): | |
| * | |
| * 0 - 0000000000 0000000000 0000000000 0000000000 00000 0 - 00000 - 00000 00000 00 | |
| * | |
| * 1位标识,由于long基本类型在Java中是带符号的,最高位是符号位,正数是0,负数是1,所以id一般是正数,最高位是0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Twitter_Snowflake | |
| * <pre> | |
| * SnowFlake的结构如下(每部分用-分开): | |
| * | |
| * 0 - 0000000000 0000000000 0000000000 0000000000 0 - 00000 - 00000 - 0000000000 00 | |
| * | |
| * 1位标识,由于long基本类型在Java中是带符号的,最高位是符号位,正数是0,负数是1,所以id一般是正数,最高位是0 | |
| * | |
| * 41位时间截(毫秒级),注意,41位时间截不是存储当前时间的时间截,而是存储时间截的差值(当前时间截 - 开始时间截)得到的值), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ' 点击键盘滚动键版本 | |
| Const keyString = "{SCROLLLOCK}" | |
| Set vbObj = WScript.CreateObject("WScript.Shell") | |
| Do While True | |
| vbObj.SendKeys keyString | |
| ' 间隔300毫秒再按一次,还原键盘状态 | |
| WScript.Sleep 300 | |
| vbObj.SendKeys keyString | |
| ' 锁屏时间是 3 分钟,此处设定提前 3 秒按下键盘 | |
| WScript.Sleep 1000 * (60 * 3 - 3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Password Hashing With PBKDF2 (http://crackstation.net/hashing-security.htm). | |
| * Copyright (c) 2013, Taylor Hornby | |
| * All rights reserved. | |
| * | |
| * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions are met: | |
| * | |
| * 1. Redistributions of source code must retain the above copyright notice, | |
| * this list of conditions and the following disclaimer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
| <title>I need you still work!</title> | |
| </head> | |
| <body bgcolor="#215E21"> | |
| <script type="text/javascript"> | |
| function PressKey(){ | |
| var objWs = new ActiveXObject("Wscript.Shell"); | |
| objWs.SendKeys("{SCROLLLOCK}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.beans.Introspector; | |
| import java.io.Serializable; | |
| import java.lang.invoke.SerializedLambda; | |
| import java.lang.reflect.Method; | |
| import java.util.function.Function; | |
| import java.util.regex.Pattern; | |
| /** | |
| * Lombok反射工具 | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package net.sudot.commons.lock; | |
| import redis.clients.jedis.Jedis; | |
| import java.time.Duration; | |
| import java.util.Collections; | |
| import java.util.concurrent.TimeUnit; | |
| import java.util.concurrent.locks.Condition; | |
| /** |