Skip to content

Instantly share code, notes, and snippets.

@vkz
vkz / FSharp.Charting.sh
Last active August 29, 2015 13:57
FSharp.Charting issue #29
bash-3.2$ pwd
/Users/vkz/Projects/chart
bash-3.2$ ls
a.fsx packages.config
bash-3.2$ cat packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FSharp.Charting.Gtk" version="0.90.5" targetFramework="net40" />

Keybase proof

I hereby claim:

  • I am vkz on github.
  • I am vkz (https://keybase.io/vkz) on keybase.
  • I have a public key whose fingerprint is 2DA6 BA4C 29F6 F80C 8D81 BA14 8D00 922A 68A7 0A21

To claim this, I am signing this object:

@vkz
vkz / wat.js
Created August 19, 2014 11:10
anything*:binding
var ometajs_ = require('ometajs');
var AbstractGrammar = ometajs_.grammars.AbstractGrammar;
var BSJSParser = ometajs_.grammars.BSJSParser;
var BSJSIdentity = ometajs_.grammars.BSJSIdentity;
var BSJSTranslator = ometajs_.grammars.BSJSTranslator;
var ometajs = require('ometajs');
var G = function G(source, opts) {
AbstractGrammar.call(this, source, opts);
};
G.grammarName = 'G';
@vkz
vkz / grammar.ometajs
Created September 1, 2014 08:53
Breaking associativity in OMeta
var ometajs = require('ometajs'),
Parser = ometajs.grammars.BSJSParser;
// Source: http://tratt.net/laurie/research/pubs/html/tratt__direct_left_recursive_parsing_expression_grammars/
// '1-2-3' -> ((1-2)-3)
ometa a <: Parser {
Expr = Expr:l "-" Num:r -> [l, '-', r]
| Num:i -> [i],
Num = /[0-9]+/
@vkz
vkz / bemxjst1.md
Last active August 29, 2015 14:11
bemxjst applyCtx() косяк или фича

Отдаем bemxjst такой шаблон:

block('b1').mod('m1', 'v1').content()('B');
block('b1').content()('a');
block('b1').content()(function () {return [applyCtx({'mods': {'m1':'v1'}}), 'b'];});

Получаем такой результат:

function applyc(__$ctx, __$ref) {
@vkz
vkz / apply.bemhtml
Created April 23, 2015 10:28
apply with mode
block b1, content: applyNext(this.bla = 'bla', 'default', this.ctx.b = 'b')
@vkz
vkz / strings.js
Last active August 29, 2015 14:21
String literal values in JS
// Parse and serialize JS string-literals
var esprima = require("esprima"),
esgen = require("escodegen").generate;
// Esprima.parse differentiates between the string-literal (raw) and it's
// content (value)
esprima.parse('a = "привет"')
// =>
@vkz
vkz / brew-doctor
Created July 20, 2013 15:14
Troubleshooting Hombrew scsh installation
vkz@vkz-air:/usr/local$ brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
@vkz
vkz / geiser-module-mismatch.md
Last active December 27, 2015 15:09
Geiser: ?: module mismatch

Suddenly started getting this error when running C-c C-a geiser-mode-switch-to-repl-and-enter from this source file. Came out of nowhere. This worked fine on the same source. I did some changes and stashed them with git stash essentially reverting to a file that ran fine before. Works without a glitch in DrRacket. Reinstalling geiser didn't help. Curiously C-c C-z back into source file and issuing C-c C-a again does enter! the module, but does'n run the body. All definitions available in the REPL.

Aside from doing stuff with git, I also replaced my Racket installation a couple of times.

Updated error message after reinstalling Racket

Why the hell does it try to read /Users/vkz/Library/Racket/planet/300/snapshot/cache/soegaard/sicp.plt/2/1/compiled/info_ss.zo I never ever reference it in my code. Bizarre

After killing the contents of ~/Library/Racket/ I stopped getting the wrong version message but the ?: module mismatch; and the rest

@vkz
vkz / init.el
Created February 11, 2016 17:29
Use cider-refresh to get Parens of the Dead reloading
(with-eval-after-load 'cider
(add-hook 'cider-mode-hook
(lambda ()
(add-hook 'after-save-hook 'cider-refresh nil 'make-it-local))))