Skip to content

Instantly share code, notes, and snippets.

// derived from https://github.com/scniro/react-codemirror2/blob/master/src/index.tsx
import React from 'react'
const SERVER_RENDERED = process.env.UIX_ENV == 'express'
let CodeMirror
if (!SERVER_RENDERED) {
CodeMirror = require('codemirror')
}
@thecere
thecere / javascript.lua
Last active March 24, 2018 18:52
scite js/jsx lua lexer
-- Copyright 2006-2015 Mitchell mitchell.att.foicica.com. See LICENSE.
-- JavaScript LPeg lexer.
local l = require('lexer')
local token, word_match = l.token, l.word_match
local P, R, S = lpeg.P, lpeg.R, lpeg.S
local M = {_NAME = 'javascript'}
-- Whitespace.
@thecere
thecere / variants.py
Created March 29, 2012 19:37
variants stuff
# -*- coding: utf-8 -*-
try:
from lxml import etree
except ImportError:
import xml.etree.ElementTree as etree
import StringIO
import time
from itertools import product
s = """