Skip to content

Instantly share code, notes, and snippets.

<link rel="import" href="template-component.html">
<script>
class HomePage extends TemplateComponent {
constructor() {
super(HomePage.is);
}
static get is() {
return 'hello-world';
}
<!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>
{
@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.

{
"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 / string-template.js
Last active November 17, 2016 09:36
Reusable template strings
// Reusable template strings
// JSON and template literals
String.template = (template, data) => new Function('return `'+template+'`').call(data);
/*
String.template("Hello ${this.name}", { name: 'Jeremy' });
Would return "Hello Jeremy"
@enjikaka
enjikaka / scale-canvas.js
Created November 4, 2016 20:09 — forked from callumlocke/scale-canvas.ts
Function to fix a canvas so it will look good on retina/hi-DPI screens.
/**
* This function takes a canvas, context, width and height. It scales both the
* canvas and the context in such a way that everything you draw will be as
* sharp as possible for the device.
*
* It doesn't return anything, it just modifies whatever canvas and context you
* pass in.
*
* Adapted from Paul Lewis's code here:
* http://www.html5rocks.com/en/tutorials/canvas/hidpi/
{
"version": "1.0",
"type": "rich",
"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 / Preferences.sublime-settings
Last active April 6, 2016 11:29
Material Theme Sublime Text 3 Config for OS X - Jeremy Karlsson
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"font_face": "Hasklig Medium",
"font_options":
[
"gray_antialias",
"subpixel_antialias"
],