let server = http.newServer()
server.address = ":8081"
server.handler = (w, r) => w.write("Hello, World!")
server.start()
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
namespace A { | |
export class PeriodPicker extends Input { | |
private closeIconPanel: Control | |
input: HTMLInputElement | |
popup: Popup | |
constructor() { | |
super("A-PeriodPicker") |
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 * as web from "lib/web" | |
import * as env from "lib/env" | |
import * as orm from "lib/orm" | |
let upgrader = websocket.newUpgrader() | |
let webSockets: WebSocketManager | |
function init() { | |
webSockets = new WebSocketManager() | |
} |
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 main | |
import ( | |
"fmt" | |
) | |
func main() { | |
var i uint32 | |
// set the first 5 bits with the num 12 |
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
export class Control { | |
readonly element: HTMLElement | |
protected children: Control[] | |
private _parent: Control; | |
constructor(element: string | HTMLElement, className?: string, parent?: Control, content?: string | Control) { | |
if (typeof element === "string") { | |
element = document.createElement(element) | |
} |
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
namespace UI { | |
const subtitle = T("@@or drop a file to upload") | |
interface Position { | |
x: number | |
y: number | |
} | |
interface Bounds { |
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
namespace S { | |
let formats: any = {} | |
let systemLocation = Intl.DateTimeFormat().resolvedOptions().timeZone | |
export class Date { | |
private _date: globalThis.Date | |
private _location: string | |
private _locationOffset: number |
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
https://www.mets-blog.com/java-pos-thermal-printer-example/ | |
https://stackoverflow.com/questions/17505070/printing-reciepts-with-thermal-printer-in-java/39381849 | |
Here it is, usb pos thermal printer solution. It is purely in java. The only condition is that your printer is recognized by the OS as a printer 🙂 | |
That means it will show up in the printers list and queue. Getting the latest drivers should do it. | |
And as a bonus it works in Windows, Mac, Linux(yes tried in all of them). You are welcome Internet. | |
Note: If anyone knows how to draw stuff and change fonts with pos commands will be great. Make small tutorial in java. | |
PrinterService.java |
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 TUNNEL_HEIGHT = 0.26 | |
const MAIN_LOOP_DELAY_MILIS = 15 | |
const START_DELAY_MILLIS = 1000 | |
export function main() { | |
terminal.init() | |
defer(() => terminal.close()) | |
let size = terminal.size() | |
let map = generateMap(size.width, size.height) |
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 "stdlib/native" | |
export function main() { | |
let url = http.parseURL("https://example.com/") | |
let proxy = httputil.newSingleHostReverseProxy(url) | |
let server = http.newServer() | |
server.addressTLS = ":9999" | |
let c = tls.generateCert() | |
let tlsConf = tls.newConfig(true) |
NewerOlder