Skip to content

Instantly share code, notes, and snippets.

https://support.brother.com/g/b/manualtop.aspx?c=us&lang=en&prod=p710bteus
https://stackoverflow.com/questions/55398308/virtual-esc-pos-printer
https://www.brother-usa.com/products/ptp710bt#
https://developerprogram.brother-usa.com/
https://www.youtube.com/watch?v=5tGvXEmaJx8
https://www.brother.co.jp/eng/dev/index.aspx#model
https://support.brother.com/g/b/manualtop.aspx?c=us&lang=en&prod=lpql700eus - potencjalnie tańsza drukareczka
https://github.com/ka2n/ptouchgo/blob/4d620fb30196322ca1318e6de8efa55b0cf5657f/ptouch.go - stałe z p710BT w go
@dmnk89
dmnk89 / fileDownload.java
Created December 6, 2016 12:54
Downloading file with spring boot
@GetMapping("/{id}/attachments/{filename:.+}")
public FileSystemResource getFile(
@PathVariable("id") Long id,
@PathVariable("filename") String filename,
HttpServletResponse response
) throws IOException {
response.setHeader("Content-Disposition", "attachment; filename=" + filename);
response.setHeader("Content-Type", "application/octet-stream");
return new FileSystemResource(service.getFile(id, filename));
}
{
"threadName": "http-nio-8080-exec-8",
"threadId": 38,
"blockedTime": -1,
"blockedCount": 2,
"waitedTime": -1,
"waitedCount": 19,
"lockName": "java.util.concurrent.CountDownLatch$Sync@48ed118d",
package pl.japila.scalania.s99
object S99_P17 {
def split[T](n: Int, ts: Seq[T]): (Seq[T], Seq[T]) = {
def go(left: Seq[T], right: Seq[T], n: Int): (Seq[T], Seq[T]) = right match {
case Nil => (left, right)
case h :: tail if n > 0 => go(left :+ h, tail, n - 1)
case _ => (left, right)
}
def randomSelect[T](n: Int, ts: Seq[T]): Seq[T] =
(0 until n).foldLeft( Seq[T]() )((r, _) => (r :+ ts(Random.nextInt(ts.size))))
@dmnk89
dmnk89 / drop_i_take.scala
Last active December 27, 2015 00:28
S99_P18
object S99_P18 {
def slice[T](from: Int, to: Int, ts: Seq[T]): Seq[T] = ts.drop(from).take(to - from)
}
object S99_P17 {
def split[T](n: Int, ts: Seq[T]): (Seq[T], Seq[T]) = ts.splitAt(n)
}