Skip to content

Instantly share code, notes, and snippets.


gmarik gmarik

View GitHub Profile
gmarik /
Created Feb 8, 2021 — forked from zaach/
New Jison 0.3 features

Some improvements have been made for parser and lexer grammars in Jison 0.3 (demonstrated in the FlooP/BlooP example below.)

For lexers:

  • Patterns may use unquoted characters instead of strings
  • Two new options, %options flex case-insensitive
  • flex: the rule with the longest match is used, and no word boundary patterns are added
  • case-insensitive: all patterns are case insensitive
  • User code section is included in the generated module

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$" "$extension_id%26uc" 
unzip -d "$extension_id-source" "$"

Thx to crxviewer for the magic download URL.

gmarik / latency.txt
Created Jul 2, 2020 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
gmarik /
Created Jun 23, 2020 — forked from soarez/
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

gmarik / clojure-match.clj
Created Jun 23, 2020 — forked from ckirkendall/clojure-match.clj
Language Compare F#, Ocaml, Scala, Clojure, Ruby and Haskell - Simple AST example
View clojure-match.clj
(use '[clojure.core.match :only [match]])
(defn evaluate [env [sym x y]]
(match [sym]
['Number] x
['Add] (+ (evaluate env x) (evaluate env y))
['Multiply] (* (evaluate env x) (evaluate env y))
['Variable] (env x)))
(def environment {"a" 3, "b" 4, "c" 5})
View Crawler.go
package main
import (
gmarik /
Last active Jun 23, 2020 — forked from labnol/
How to Learn Google Apps Script - The best resources for learning Google Apps Script, the glue that connects GSuite services including Gmail, Google Drive, Calendar, Maps, Analytics and more.

Learning Google Apps Script

The best place to learn more about Google Script is the official documentation available at Here are other places that will help you get up to speed.

  2. Google Apps Scripts - Snippets by +Amit Agarwal
  3. Apps Script Starter - Create Google Apps Script projects locally inside VS Code.
  4. Digital Inspiration by +Amit Agarwal - Google Addons
  5. Awesome Google Scripts by +Amit Agarwal
  6. Build with Google Apps Script - Setup a local development environment for Apps Script
gmarik / Dockerfile
Created Sep 29, 2019 — forked from Irio/Dockerfile
GCP Serverless scrapers
View Dockerfile
FROM golang:1.12 as build
COPY scraper scraper
COPY main.go .
RUN go get -d -v ./...
RUN go install
gmarik / analyze.go
Created Nov 12, 2015 — forked from nf/analyze.go
'spent' script to log where time is spent
View analyze.go
package main
import (
View chat.go
package main
import (
type Client struct {
incoming chan string