Skip to content

Instantly share code, notes, and snippets.

View trickster's full-sized avatar
🎯
Focusing

Sivaram Konanki trickster

🎯
Focusing
  • Tokyo
  • 02:19 (UTC +09:00)
View GitHub Profile
//! This crate provides types for UCD’s `Blocks.txt`.
pub struct Blocks {
ranges: Vec<(RangeInclusive<u32>, String)>,
}
impl Blocks {
pub fn block_of(&self, c: char) -> &str {
self.ranges
.binary_search_by(|(range, _)| {
@CrockAgile
CrockAgile / earley_parsing_explained.md
Last active June 22, 2024 00:01
Earley Parsing Explained

Earley Parsing Explained

Twitter Follow

flowchart TD
0["sum"] --> 1["sum"]
1["sum"] --> 2["product"]
2["product"] --> 3["factor"]
3["factor"] --&gt; 4["number"]
@terasakisatoshi
terasakisatoshi / animation.jl
Last active May 31, 2021 00:01
Share your HTML generated by Pluto notebook
### A Pluto.jl notebook ###
# v0.14.7
using Markdown
using InteractiveUtils
# ╔═╡ c25a642a-c146-11eb-2198-d79dcea09223
using Plots
# ╔═╡ a69123f6-c718-4057-a370-1f8e2908f36d
use std::{
fs::File,
io::{Read, Write},
time::Instant,
};
use tokio::task::{self, JoinHandle};
async fn compute() {
let handles: Vec<JoinHandle<_>> = (0..1000)
.map(|_| {
@bcherny
bcherny / designing-data-intensive-application-notes.md
Last active July 2, 2025 06:41
Notes: Designing Data-Intensive Applications

Notes on Martin Kleppmann's excellent Designing Data-Intensive Applications.

Chapter 1: Reliable, Scalable, and Maintainable Applications

  • Data Systems
    • Dimensions to consider when thinking about data systems: access patterns, performance characteristics, implementations.
    • Modern data systems often blur the lines between databases, caches, streams, etc.
  • Reliability
    • Systems should perform the expected function at a given level of performance, and be tolerant to faults and user mistakes
  • Fault: One component of a system deviating from its spec. Prefer tolerating faults over preventing them (except for things like security issues). Faults stem from hardware failures, software failures, and human error (in a study, config errors caused most outages).
@iravid
iravid / MapReduce.scala
Created June 28, 2019 06:06
Map-Reduce with ZIO
import $ivy.`dev.zio::zio:1.0.0-RC8-12`
import $ivy.`dev.zio::zio-streams:1.0.0-RC8-12`
import zio._, zio.stream._
object Step1 {
import java.nio.file.{Files, Paths, Path}
import scala.collection.JavaConverters._
import zio.blocking._
@bhauman
bhauman / Basic_Figwheel_Main_Example.md
Last active April 30, 2022 17:16
Base Figwheel Main example

Minimal Figwheel Main project

This is the base example project that is the assumed a starting point for most of the examples in the Figwheel Main documentation.

You can run it with the Clojure Tools in your terminal via:

$ clj -m figwheel.main -b dev -r
@pvik
pvik / smartparens-cheatsheet.md
Last active December 16, 2024 17:54
A Cheatsheet for Emacs Smarparens example configuration

An animated cheatsheet for smartparens using the example configuration specified here by the smartparens author. Inspired by this tutorial for paredit.

Traversal

C-M-f sp-forward-sexp
C-M-b sp-backward-sexp
@mfikes
mfikes / README.md
Last active May 17, 2020 02:37
Seeing the inferred type of a ClojureScript expression

If you are curious about the types inferred by ClojureScript, it is easy to get some insight using a macro:

(defmacro inferred-type [form]
  `'~(cljs.analyzer/infer-tag &env
       (cljs.analyzer/no-warn (cljs.analyzer/analyze &env form))))

This is the kind of dev-time macro you could refer using the new user.cljs feature.

@santi-pdp
santi-pdp / Hello PyTorch.ipynb
Created January 24, 2018 17:53
Toy example in pytorch for binary classification
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.