:note

Javascript

Hugo syntaxhighlight test

CDN経由の highlight.js でよみこまれない言語のうち以下を追加 <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/languages/go.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/languages/yaml.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/languages/applescript.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/languages/processing.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/languages/scss.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/languages/haml.min.js"></script> Golang package main import "fmt" func main() { fmt.Println("hello world") } YAML invoice: 34843 date : 2001-01-23 bill-to: &id001 given : Chris family : Dumars address: lines: | 458 Walkman Dr. Suite #292

jsとrubyで構文解析

構文解析 polygonplanet/Chiffon A very small ECMAScript parser, tokenizer and minify written in JavaScript. var Chiffon = require('chiffon'); var code = "#target 'InDesign'\nvar doc = app.documents[0];\nvar foo=1;\t\tif (foo === 0){ doc.textFrames.add() }"; var tokens = Chiffon.tokenize(code); console.log(tokens); var unto = Chiffon.untokenize ( tokens ); console.log(unto); var minim = Chiffon.minify(code); console.log(minim); // % node index.js // [ { type: 'Identifier', value: '#target' }, // { type: 'String', value: '\'InDesign\''

!! で true

Sinatra Best Practices: Part One | The Carbon Emitter をみていて、今まで !! ってつかったことなかったのでメモ jsx(javascript) #target "illustrator" var session = {}; session['usr'] = "hello"; session['undefined_usr']; // undefined, nullでも同様 $.writeln( session['usr'] ); // "hello" $.writeln( !session['usr'] ); // false $.writeln( !!session['usr'] ); //

back to top