Skip to content

Instantly share code, notes, and snippets.

View enjikaka's full-sized avatar

Jeremy Karlsson enjikaka

View GitHub Profile
{
"version": "1.0",
"type": "video",
"provider_name": "TIDAL",
"provider_url": "http://tidal.com/",
"width": 450,
"height": 180,
"title": "God is a girl",
"html": "<div class=tidal-embed data-type=t data-id=1176380></div><script src=https://embed.tidal.com/tidal-embed.js></script>"
}
@enjikaka
enjikaka / ocr.markdown
Created January 3, 2017 20:07 — forked from henrik/ocr.markdown
OCR on OS X with tesseract

Install ImageMagick for image conversion:

brew install imagemagick

Install tesseract for OCR:

brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.

<!DOCTYPE html>
<html>
<head>
<link rel="import" href="hello-world.html">
<link rel="import" href="ssr-data.html">
</head>
<body>
<hello-world></hello-world>
<ssr-data>
{
<!DOCTYPE html>
<html>
<head>
<link rel="import" href="hello-world.html">
<link rel="import" href="ssr-data.html">
</head>
<body>
<hello-world></hello-world>
<ssr-data>
{
<link rel="import" href="template-component.html">
<script>
class HomePage extends TemplateComponent {
constructor() {
super(HomePage.is);
}
static get is() {
return 'hello-world';
}
<link rel="import" href="template-component.html">
<script>
class HelloWorld extends TemplateComponent {
constructor() {
super(HelloWorld.is);
}
static get is() {
return 'hello-world';
}
class TemplateComponent extends HTMLElement {
constructor (tagName) {
super();
if (!tagName) {
throw new Error('You did now specify a tag name. You need to call super with the tag name in you constructor.');
}
this._tagName = tagName;
}
class TemplateComponent extends HTMLElement {
constructor (tagName) {
super();
if (!tagName) {
throw new Error('You did now specify a tag name. You need to call super with the tag name in you constructor.');
}
this._tagName = tagName;
}
class TemplateComponent extends HTMLElement {
constructor (tagName) {
super();
if (!tagName) {
throw new Error('You did now specify a tag name. You need to call super with the tag name in you constructor.');
}
this._tagName = tagName;
}
class TemplateComponent extends HTMLElement {
/*...*/
get path () {
const query = `link[rel="import"][href*="${this._tagName}"]`;
const target = document.head.querySelector(query);
return target.href.split(document.location.host)[1];
}
/*...*/
}