Skip to content

Instantly share code, notes, and snippets.

@achun
achun / index.js
Last active May 13, 2018 15:11
requirebin sketch
// powcss demonstration
const powcss=require('powcss');
let pre = document.createElement('pre');
pre.textContent = powcss([]).run(
`
let /**/
rem=(px) => px/16 +'rem', /*Line-Continuation*/
spacing=(tracking)=>tracking/12 +'rem',
cols = [1,2,3,4].join(',.col-')
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="//unpkg.com/materialize-css/dist/css/materialize.min.css" media="screen,projection"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<nav>
<div class="nav-wrapper">
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: zxx
file_extensions:
- zxx
first_line_match: "-[*]-( Mode:)? Zxx -[*]-"
scope: source.zxx
contexts:
@achun
achun / gulpfile.js
Last active January 19, 2016 13:48
gulp + webpack
var batch = require('gulp-batch');
var gulp = require('gulp');
function getPackageJson() {
var fs = require('fs');
return JSON.parse(fs.readFileSync('./package.json', 'utf8'));
};
gulp.task('bump', function(cb) {
var tag = require('minimist')(process.argv.slice(2)).tag || 'patch';
@achun
achun / WebEvents.js
Created January 1, 2015 04:18
Everyone to improve
// https://developer.mozilla.org/en-US/docs/Web/Events
(function(global) {
"use strict"
global.StandardEvents = {
"Animation": {
"animationend": {
"url": "https://developer.mozilla.org/en-US/docs/Web/Events/animationend",
"Specification": "CSS Animations",
"Interface": "AnimationEvent",
"Bubbles": true,
@achun
achun / htmlLex.js
Created December 23, 2014 08:56
合法 html 文本进行词法解析
var LOOP = 'LOOP' + Math.random(),
BREAK = 'BREAK' + Math.random()
/**
htmlLex 对合法 html 文本进行词法解析.
参数:
合法 html 文本
*/
function htmlLex() {
var pos, m, k, v, html, fn
@achun
achun / gox.text
Last active May 20, 2021 20:07
go get golang.org/x
go get -u golang.org/x/crypto/bcrypt
go get -u golang.org/x/crypto/blowfish
go get -u golang.org/x/crypto/bn256
go get -u golang.org/x/crypto/cast5
go get -u golang.org/x/crypto/curve25519
go get -u golang.org/x/crypto/hkdf
go get -u golang.org/x/crypto/md4
go get -u golang.org/x/crypto/nacl/box
go get -u golang.org/x/crypto/nacl/secretbox
go get -u golang.org/x/crypto/ocsp
@achun
achun / gorun.go
Created March 14, 2014 07:56
build and run 合体技. 来自 Go编程语言群成员 四叶草 发的 gorun 代码.
package main
import (
"log"
"os"
"os/exec"
"path/filepath"
)
func main() {
@achun
achun / macimage.go
Created March 14, 2014 03:44
Mobile Atlas Creator sqlitdb 图片导出
package main
import (
"flag"
"fmt"
"os"
"path/filepath"
"github.com/cheggaaa/pb"
"github.com/typepress/db"
@achun
achun / rpn.go
Last active December 6, 2019 11:06
Go 四则运算词法解析相关 由中缀表达式构建AST 逆波兰序列生成
//ReversePolishnotation,RPN
//逆波兰表达式相关
//lexer 是一个中缀数学四则计算表达式词法解析器
package rpn
import (
"errors"
)
type Token int