Skip to content

Instantly share code, notes, and snippets.

@ile
ile / quill-linebreaks.js
Last active Sep 13, 2019
Quill "soft" linebreaks (<br> inside <p>) ... requires https://github.com/ilkkah/quillty
View quill-linebreaks.js
import Delta from 'quill-delta';
function create(Quill) {
const Break = Quill.import('blots/break');
const Embed = Quill.import('blots/embed');
const Parchment = Quill.import('parchment');
const Inline = Quill.import('blots/inline');
const TextBlot = Quill.import('blots/text');
const Block = Quill.import('blots/block');
const LINEBREAK_CHAR = '\u000b'
View embed-rocks-test.php
<?php
$opts = array(
'http'=>array(
'method'=> "GET",
'header'=> "x-api-key:your-key"
)
);
$context = stream_context_create($opts);
View gist:3a2765c6b99a0889decb1d0d5dff1c0d
root@pc:/var/log# service arangodb3 restart
Job for arangodb3.service failed because the control process exited with error code. See "systemctl status arangodb3.service" and "journalctl -xe" for details.
root@pc:/var/log# systemctl status arangodb3.service
● arangodb3.service - LSB: arangodb
Loaded: loaded (/etc/init.d/arangodb3; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2017-04-09 17:33:29 EDT; 18s ago
Docs: man:systemd-sysv-generator(8)
Process: 13075 ExecStop=/etc/init.d/arangodb3 stop (code=exited, status=0/SUCCESS)
Process: 13086 ExecStart=/etc/init.d/arangodb3 start (code=exited, status=1/FAILURE)
Tasks: 23
View card.styl
@import './const'
.vplay
position relative
float left
overflow hidden
img
float none
View card.css
.vplay {
position: relative;
float: left;
overflow: hidden;
}
.vplay img {
float: none;
}
View card.coffee
app = require '../index'
class Card
html5Video: ->
item = @model.get 'item'
item?.type is 'video' and (item?.videos?[0]?.type?.substring(0, 5) is 'video' and item?.videos?[0]?.type not in ['video/flash', 'text/html'])
iframeVideo: ->
item = @model.get 'item'
View safe.conf
# optional, we will cache images for a certain time
proxy_cache_path /tmp/cache levels=1:2 keys_zone=embed:30m max_size=1g inactive=24h use_temp_path=off;
# optional - ssl
# disable, if not in use
proxy_ssl_server_name on;
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
server {
listen 80;
View card.mustache
<index:>
{{if item}}
<div class="card{{if big}} card-big{{/}}{{if (item.videos.length || allowOembed())}} card-video{{/}}{{if (item.type == 'audio')}} card-audio{{/}}">
{{if preferOembed()}}
<oembed></oembed>
{{else if (item.type == 'photo' && item.images.length) }}
<single-image image="//safe.chttr.co/{{item.images[0].safe}}"></single-image>
{{else if (item.oembed.type == 'photo' && item.oembed.images.length) }}
<single-image image="//safe.chttr.co/{{item.oembed.images[0].safe}}"></single-image>
{{else if (item.images.length && !play)}}
View phantom.txt
myapp phantomjscloud get +322ms http://www.breitbart.com/big-government/2016/12/22/house-snowden-report-says-he-damaged-national-security/
2016-12-23T16:32:04.811Z promise.logPromiseUnhandledRejections ERROR xlib.diagnostics.logging.logPromiseUnhandledRejections()=>unhandledRejection {
"[*TYPE*]": "Error",
name: "Error",
message: "operation timed out after 30086 ms, 2 tries with error: timeout of 15000ms exceeded",
stack: [
"Error: operation timed out after 30086 ms, 2 tries with error: timeout of 15000ms exceeded",
" at /src/myapp/node_modules/xlib/src/internal/bluebird-retry.ts:137:40",
" at tryCatcher (/src/myapp/node_modules/xlib/node_modules/bluebird/js/release/util.js:16:23)",
" at /src/myapp/node_modules/xlib/node_modules/bluebird/js/release/catch_filter.js:24:41",
View keybase.md

Keybase proof

I hereby claim:

  • I am ile on github.
  • I am ilkkah (https://keybase.io/ilkkah) on keybase.
  • I have a public key whose fingerprint is BFBF 3E54 C937 59EA FFFF 1FE6 9B0D 0799 19BE EDC0

To claim this, I am signing this object: