Skip to content

Instantly share code, notes, and snippets.

@kddlb
kddlb / thermalparser.js
Created August 15, 2017 03:22
JSON "markup" to ESC/POS
exports.parseToControlCommands = function (ob) {
let ns = "";
ob.input.forEach(function (t, number, ts) {
if (typeof(t) === "string") {
ns = ns.concat(t)
} else {
switch (t.command) {
case "tab":
ns = ns.concat("\x09");
break;
@kddlb
kddlb / ZNCLog-Regex.md
Last active September 19, 2016 23:01
ZNC Log JSON

Message: ^\[(?'Date'\d{2}:\d{2}:\d{2})\] <(?'Nickname'.*)> (?'Message'.*)$

Notice: ^\[(?'Date'\d{2}:\d{2}:\d{2})\] -(?'Nickname'.*)- (?'Message'.*)$

Joins: ^\[(?'Date'\d{2}:\d{2}:\d{2})\] \*\*\* (?'Happening'Joins): (?'Nickname'.*) \((?'Hostmask'(?'Username'.*)@(?'Hostname'.*))\)$

PartsOrQuits:

@kddlb
kddlb / api_oneliner.php
Created May 12, 2016 19:17
YUO’s titler
<?php
if ($argc > 1) {
date_default_timezone_set("UTC");
function udate($format, $utimestamp = null) {
if (is_null($utimestamp)) {
$utimestamp = microtime(true);
}
@kddlb
kddlb / getVoices.swift
Created May 1, 2016 01:34
Get all voices on an OS X system as a JSON
#!/usr/bin/swift
import Foundation
import Cocoa
var voices = NSSpeechSynthesizer.availableVoices();
var locale = NSLocale.init(localeIdentifier: "en-us");
var voicesInfo = [String:AnyObject]();
for voice in voices {
[[inpt TUNE]]
~
AY {D 200; P 306.0:0 124.0:68}
_
n {D 60; P 124.0:0 188.0:39}
1OW {D 170; P 253.0:0 189.0:5 126.0:29 125.0:62 123.0:67 122.0:86}
~
w {D 100; P 180.0:0 150.0:60}
2EH {D 100; P 121.0:0}
n {D 70; P 114.0:0}

Keybase proof

I hereby claim:

  • I am kddlb on github.
  • I am kddlb (https://keybase.io/kddlb) on keybase.
  • I have a public key whose fingerprint is F77A E07D 0D53 FE16 3467 CCC1 703A A2AC 782E 1DE6

To claim this, I am signing this object:

@kddlb
kddlb / BingTranslatorAPI.java
Created August 3, 2014 18:55
Bing translator API
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cl.kelopez.bingtranslator;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
@kddlb
kddlb / designer.html
Created June 27, 2014 23:14
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../paper-input/paper-input.html">
<polymer-element name="my-element">
@kddlb
kddlb / designer.html
Created June 26, 2014 01:13
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="Promediator-App">
<template>
<style>
:host {
position: absolute;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package resarg;
/**
*