Skip to content

Instantly share code, notes, and snippets.

View ubolonton's full-sized avatar
🛠️

Tuấn-Anh Nguyễn ubolonton

🛠️
View GitHub Profile
(require 'tree-sitter)
(require 'tree-sitter-hl)
(defvar ppl--base-dir
(file-name-directory load-file-name)
"Directory containing this file.")
(define-derived-mode ppl-mode prog-mode "PPL"
"Major mode for editing PPL files."
(setq tree-sitter-language (tree-sitter-require 'ppl))
@ubolonton
ubolonton / init.el
Created October 26, 2020 11:51
Minimal ~/.emacs.d/init.el with tree-sitter setup through MELPA
(require 'package)
(dolist (source '(("melpa" . "https://melpa.org/packages/")))
(add-to-list 'package-archives source t))
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
@ubolonton
ubolonton / init.el
Last active October 14, 2020 10:38
Minimal ~/.emacs.d/init.el with tree-sitter setup through straight.el
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
@ubolonton
ubolonton / log.inline-rule.html
Created July 11, 2020 03:00
tree-sitter's parse logs of inline named rule vs rule written inline
<!DOCTYPE html>
<style>svg { width: 100%; }</style>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.40.1 (20161225.0304)
-->
<!-- Title: %3 Pages: 1 -->
<svg width="84pt" height="31pt"
<!DOCTYPE html>
<style>svg { width: 100%; }</style>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.40.1 (20161225.0304)
-->
<!-- Title: %3 Pages: 1 -->
<svg width="84pt" height="31pt"
<!DOCTYPE html>
<style>svg { width: 100%; }</style>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.40.1 (20161225.0304)
-->
<!-- Title: %3 Pages: 1 -->
<svg width="84pt" height="31pt"
@ubolonton
ubolonton / init.el
Created June 10, 2020 05:38
straight.el + use-package + tree-sitter
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
use std::{mem, ptr, os, rc::Rc, cell:RefCell, marker::PhantomData};
// -------------------------------------------------------------------
// Structs declared in a C header.
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_Tree {
_unused: [u8; 0],
}

Keybase proof

I hereby claim:

  • I am ubolonton on github.
  • I am ubolonton (https://keybase.io/ubolonton) on keybase.
  • I have a public key ASCPTWf5AFtrjJP6uTt05OVrAW-5rGFlgETHDxN5Ghgscwo

To claim this, I am signing this object:

@ubolonton
ubolonton / firebase.html
Created February 8, 2015 12:09
js-csp and Firebase (Firefox only)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<meta name="description" content="">
<meta name="author" content="">
<title>Rx for JavaScript Rocks!</title>
</head>