Skip to content

Instantly share code, notes, and snippets.

View ilya-klyuchnikov's full-sized avatar
👁️‍🗨️

ilya-klyuchnikov

👁️‍🗨️
View GitHub Profile
@Aerijo
Aerijo / tree_sitter_guide.md
Last active March 30, 2024 15:19
Guide to writing your first Tree-sitter grammar

Guide to your first Tree-sitter grammar

NOTE: The Tree-sitter API and documentation has changed and improved since this guide was created. I can't guarantee this is up to date.

About

Tree-sitter is the new way Atom is providing language recognition features, such as syntax highlighting, code folding, autocomplete, and more. In contrast to TextMate grammars, which work by regex matching, Tree-sitter will generate an entire syntax tree. But more on that can be found in it's own docs.

Here, we look at making one from scratch.

@rudolfratusinski
rudolfratusinski / parallels_tools_ubuntu_new_kernel_fix.md
Last active November 23, 2022 20:01
Parallels Tools fix for Ubuntu 18.04 and other Linux distributions with Kernel version >= 4.15

Preparation

  • In open Ubuntu 18.04 machine click Parallels Actions -> "Install Parallels Tools"

  • A "Parallels Tools" CD will popup on your Ubuntu desktop.

  • Open it by double mouse click, copy all the content to a new, empty directory on a desktop, name it for e.g. "parallels_fixed"

  • Open terminal, change directory to parallels_fixed (cd ~/Desktop/parallels_fixed)

  • Make command line installer executable (chmod +x install)

  • Change directory to "installer" (cd installer)

  • Make few other scripts executable: chmod +x installer.* *.sh prl_*

@AndreasHassing
AndreasHassing / InstallingFsYaccFsLexOSX.md
Last active August 8, 2022 06:47
How to get FsYacc and FsLex (FsLexYacc) on OS X

Installing FsYacc and FsLex (FsLexYacc) on OS X

Step by step guide to getting FsYacc and FsLex for development on OS X.

Changes

  • 2017-01-09: Updated guide to reflect latest version of FsLexYacc (7.0.3)
  • 2016: Created

1. Install Mono

By doing one of these:

@rprichard
rprichard / NamedPipeTest.cc
Last active July 31, 2022 08:34
Windows Named Pipe Test (Connection and Disconnection)
// Dedicated to the public domain as per the Creative Commons CC0
// (https://creativecommons.org/about/cc0/).
// Compile with C++11 (i.e. -std=c++11)
// Tests the behavior of Windows named pipes regarding the lifecycle of
// connections.
//
// This test demonstrates various ways that Wine (as of 1.9.12) differs from
// Windows:
@JamesWoolfenden
JamesWoolfenden / posh-build
Last active November 19, 2018 09:52
Powershell build functions, direct call to msbuild API.
[void][System.Reflection.Assembly]::Load('Microsoft.Build.Engine, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
[void][System.Reflection.Assembly]::Load('Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
[void][System.Reflection.Assembly]::Load('mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
function make()
{
<#
.SYNOPSIS
Builds all files according to a naming strategy found in the given or current path
(setq show-paren-style 'expression)
(show-paren-mode 2)
(menu-bar-mode -1)
(tool-bar-mode -1)
(setq make-backup-files nil) ; Don't want any backup files
(setq auto-save-list-file-name nil) ; Don't want any .saves files
(setq auto-save-default nil) ; Don't want any auto saving
@tomykaira
tomykaira / partial_evaluation.md
Created July 22, 2012 14:55
Partial Evaluation, Futamura Projection And Their Applications

Partial Evaluation, Futamura Projection And Their Applications

What Partial Evaluation Is?

Partial evaluation means to fix some variables in the given code before execution. With a traditional implementation of a compiler or an interpreter, all variables are replaced with its value on each evaluation of that variable. This is because a variable can change at any timing. This is, however, not always true in actual applications. Almost all of large applications has setting variables and data

@danking
danking / gist:1068185
Created July 6, 2011 19:55
A very simple example showing how to use Racket's lexing and parsing utilities
#lang racket
(require parser-tools/lex
(prefix-in re- parser-tools/lex-sre)
parser-tools/yacc)
(provide (all-defined-out))
(define-tokens a (NUM VAR))
(define-empty-tokens b (+ - EOF LET IN))
(define-lex-trans number
(syntax-rules ()