- Copied from a vega implementation for Elastic Search, made by yurik.
- Full spec example here, with some bug fixes from the original implementation
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 { parse } from 'parse5' | |
| import { adapter } from 'parse5-htmlparser2-tree-adapter' | |
| import xpath from 'xpath' | |
| const html = '...' | |
| const selector = '...' | |
| const doc = parse(html, { treeAdapter: adapter }) | |
| const htmlEl = doc.childNodes.find(c => c.name === 'html') |
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
| { | |
| "$schema": "http://schemas.wp.org/trunk/theme.json", | |
| "version": 2, | |
| "settings": { | |
| "layout": { | |
| "contentSize": "750px" | |
| }, | |
| "color": { | |
| "background": false, | |
| "custom": false, |
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
| #! /usr/local/bin/perl | |
| require 'ctime.pl'; | |
| require 'newgetopt.pl'; | |
| #require '/usr/local/lib/perl5/ctime.pl'; | |
| #require '/usr/local/lib/perl5/newgetopt.pl'; | |
| #require '/usr/local/lib/perl5/sys/socket.ph'; | |
| # | |
| # ----> parse_hotlist <---- | |
| # takes a file (default /chronos/c1/jerry/.hotlist |
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
| #!/usr/bin/env python | |
| ''' | |
| List all available versions of Kindle for Mac and Kindle for PC. | |
| Dependencies: | |
| - asyncio==3.4.3 | |
| - aiohttp==3.6.3 | |
| ''' | |
| import os | |
| import sys |
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
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| import json # Native JSON Library | |
| import argparse # Native Argument parser Library | |
| # This is a slightly updated version of a script found on ye cyberwebs to | |
| # add batch conversion support. Just don't specify an image ID to export the world. | |
| # ==============================# |
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
| <?php | |
| /** | |
| * @file | |
| * Drush commands. | |
| */ | |
| use Drupal\Core\Config\ConfigInstaller; | |
| use Drupal\Core\Config\FileStorage; | |
| use Drupal\Core\Config\InstallStorage; | |
| use Drupal\Core\Config\StorageInterface; |
A fork of the popular open-source contract for web designers and developers by Stuff & Nonsense, reworded for developers
- Originally published: 05/02/2014
- Original post
Between us [company name] and you [customer name]
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
| ;; This is at: https://gist.github.com/8655399 | |
| ;; So we want a rhyming dictionary in Clojure. Jack Rusher put up | |
| ;; this code here: | |
| ;; | |
| ;; https://gist.github.com/jackrusher/8640437 | |
| ;; | |
| ;; I'm going to study this code and learn as I go. | |
| ;; | |
| ;; First I put it in a namespace. |
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
| add_filter( 'image_send_to_editor', 'tiny_force_caption', 100 ); | |
| function tiny_force_caption( $html ) { | |
| $a = strpos($html, 'caption'); | |
| if ($a!=1) { | |
| preg_match('/(alignnone|alignleft|alignright|aligncenter)/', $html,$c); | |
| preg_match('/width="(\d*)"/', $html,$w); | |
| preg_match('/alt="([^"]*)"/', $html,$m); | |
| preg_match('/wp-image-(\d*)"/', $html,$n); | |
| if (!isset($n[1])) $n[1] = '0'; | |
| $html = '[caption id="attachment_'.$n[1].'" align="'.($c?$c[1]:'alignnone').'" width="'.$w[1].'"]'.$html." © ".get_bloginfo('title')."[/caption]"; |
NewerOlder