Skip to content

Instantly share code, notes, and snippets.

<script>
var module = WebAssembly.instantiateStreaming(fetch("linked_list.wasm"), {});
</script>
@sainnhe
sainnhe / everforest-dark-hard.yaml
Created April 3, 2021 01:34
Everforest base16
scheme: "Everforest dark, hard"
author: "Sainnhe Park (sainnhe@gmail.com)"
base00: "2b3339" # Default Background
base01: "323c41" # Lighter Background (Used for status bars, line number and folding marks)
base02: "503946" # Selection Background
base03: "868d80" # Comments, Invisibles, Line Highlighting
base04: "d3c6aa" # Dark Foreground (Used for status bars)
base05: "d3c6aa" # Default Foreground, Caret, Delimiters, Operators
base06: "e9e8d2" # Light Foreground (Not often used)
@cmod
cmod / hugofastsearch.md
Last active March 22, 2024 07:02 — forked from eddiewebb/readme.md
Fast, instant client side search for Hugo static site generator

Super fast, keyboard-optimized, client side Hugo search

This is a fork of and builds upon the work of Eddie Webb's search and Matthew Daly's search explorations.

It's built for the Hugo static site generator, but could be adopted to function with any json index compatible with Fuse fuzzy search library.

To see it in action, go to craigmod.com and press CMD-/ and start typing.

Fast Search

@rsms
rsms / btree.ts
Last active May 6, 2021 00:47
Compile-time constant binary tree for fast byte-array key lookups in JavaScript
export interface BTreeNode<T> {
k :ArrayLike<byte>
v :T
L? :BTreeNode<T>
R? :BTreeNode<T>
}
export class BTree<T> {
readonly root :BTreeNode<T>
constructor(root :BTreeNode<T>) {
@gaearon
gaearon / quiz.md
Last active January 11, 2024 16:56

A top-level App component returns <Button /> from its render() method.

  1. What is the relationship between <Button /> and this in that Button’s render()?

  2. Does rendering <Button><Icon /></Button> guarantee that an Icon mounts?

  3. Can the App change anything in the Button output? What and how?


@frankleng
frankleng / RHLclient.js
Last active August 1, 2016 19:05
Avoid RR warning in RHL 3.0
const createRoutes = require('../routes/root').default;
const routes = createRoutes(store);
const render = () => {
const { pathname, search, hash } = window.location;
return match({ routes, location: `${pathname}${search}${hash}` }, () => {
ReactDOM.render(
<AppContainer>
<Provider store={store}>
<Router
@trueter
trueter / dev.config.js
Created April 12, 2016 09:32
DLL Bundles with webpack-isomorphic-tools
// Webpack config for development
var fs = require( 'fs' )
var path = require( 'path' )
var webpack = require( 'webpack' )
var WebpackIsomorphicTools = require( 'webpack-isomorphic-tools' )
var HappyPack = require( 'happypack' )
var assetsPath = path.resolve( __dirname, '../static/dist' )
var host = process.env.HOST || 'localhost'
@bmhatfield
bmhatfield / .profile
Last active March 18, 2024 07:43
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
import { action } from 'common/utils/redux/redux';
@action
export class Actions {
static types = {
set3d: Symbol('set3d')
};
static set3d(val) {
@gaearon
gaearon / reducers.js
Last active December 11, 2020 14:56
How I'd do code splitting in Redux (pseudo code, not tested!)
import { combineReducers } from 'redux';
import users from './reducers/users';
import posts from './reducers/posts';
export default function createReducer(asyncReducers) {
return combineReducers({
users,
posts,
...asyncReducers
});