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 demo | |
import java.lang | |
import java.util.regex.Pattern | |
import scala.annotation.tailrec | |
import scala.collection.{BitSet, mutable} | |
import scala.io.Source | |
trait SensitiveEngine { |
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.lang.management.{ManagementFactory, MemoryUsage} | |
import java.util.concurrent.CountDownLatch | |
import java.util.concurrent.atomic.AtomicInteger | |
object Main { | |
def main(args: Array[String]): Unit = { | |
Thread.startVirtualThread { () => | |
println(s"Hello ${Thread.currentThread()}") |
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.util | |
import java.util.regex.Pattern | |
import com.gliwka.hyperscan.wrapper._ | |
object Main { | |
val regexp = """(?s)\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3})\] \[([^\[\]]+)\] \[([^\[\]]+)\] \[([^\[\]]+)\] - \[(traceId:|t:)(.*) (spanId:|s:)(-?[A-Fa-f0-9]*) (pSpanId:|p:)(-?[A-Fa-f0-9]*)] (.*)$""" | |
val line = "[2019-12-09 14:39:29.298] [INFO] [Logging-Thread-1] [com.yunji.scs.appprice.service.PriceApplicationForAppServiceImpl] - [t: s: p:] log msg" |
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
<meta name="viewport" content="width=device-width"> | |
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script> | |
<script type="module" src="my-element.js"></script> | |
<script type="module" src="sku.js"></script> | |
<script> | |
// document.onscroll = function(event){ | |
// var msg = document.getElementById("msg"); | |
// // console.info("document scroll " , event); | |
// msg.innerHTML = "scroll event: " + event.timeStamp; |
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 com.demo; | |
import java.io.IOException; | |
import java.net.InetSocketAddress; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.*; | |
import java.util.Iterator; | |
/** | |
* Created by ever on 2017/11/24. |
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
<!-- only for polyfill | |
<script src="custom-elements/src/custom-elements.js"></script> | |
--> | |
<style> | |
body { | |
margin: 0; | |
} | |
/* Style the element from the outside */ |
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 demo | |
import scala.tools.nsc.io.AbstractFile | |
import scala.tools.nsc.{Global, Phase} | |
import scala.tools.nsc.plugins.{Plugin, PluginComponent} | |
class DemoPlugin(val global: Global) extends Plugin { | |
import global._ | |
override def init(options: List[String], error: String => Unit): Boolean = true |
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
#!/bin/bash | |
# crontab | |
# * * * * * /home/wangzx/mysql-lock-wait/mysql_lock_wait_check.sh | |
function run_lock_wait() { | |
now=`date +%s` | |
seq=$(( $now / 30 % 600 )) # rotate 600 log file in 5 hours | |
logfile=~/mysql-lock-wait/log/mysql_lock_wait-$seq.log |
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 volatile_demo; | |
import java.util.concurrent.BrokenBarrierException; | |
import java.util.concurrent.CyclicBarrier; | |
public class Test2 { | |
int a = 0; | |
int b = 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
package fbw | |
object FizzBuzzWhizz { | |
implicit class RichBoolean(bool: Boolean) { | |
def option[T](value:T) = if(bool) Some(value) else None | |
} | |
implicit class RichOption[T](option:Option[T]) { | |
def elseFlatMap(value: =>Option[T]) = option match { | |
case Some(_) => option |
NewerOlder