Skip to content

Instantly share code, notes, and snippets.

View ubolonton's full-sized avatar
🛠️

Tuấn-Anh Nguyễn ubolonton

🛠️
View GitHub Profile
(defun ublt/define-keys (key-map &rest ps)
"Define key binding pairs for KEY-MAP."
(let ((i 0))
(while (< i (length ps))
(if (= (mod i 2) 0)
(let ((src (elt ps i))
(dst (elt ps (1+ i))))
(define-key key-map
(read-kbd-macro src) (if (stringp dst)
(read-kbd-macro dst)
gulp.task("js:crypto", function() {
var browserify = require("browserify");
var source = require("vinyl-source-stream");
var b = browserify({
basedir: "./"
});
b.require("crypto", {expose: "crypto"});
return b.bundle()
.pipe(source("crypto.js"))
.pipe(gulp.dest(jsOutPath));
(add-to-list 'auto-mode-alist '("\\.jsx$" . web-mode))
(defadvice web-mode-highlight-part (around tweak-jsx activate)
(if (equal web-mode-content-type "jsx")
(let ((web-mode-enable-part-face nil))
ad-do-it)
ad-do-it))
@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>

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:

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],
}
@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))
<!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 / 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"