Skip to content

Instantly share code, notes, and snippets.

View HerringtonDarkholme's full-sized avatar

Herrington Darkholme HerringtonDarkholme

View GitHub Profile
@Windsooon
Windsooon / leetcode_retag.md
Last active July 17, 2024 13:30
Retag most popular Leetcode problems

osjobs

海外兔

website

@MrPowerGamerBR
MrPowerGamerBR / amino.json
Created June 25, 2017 22:50
AminoREAPI - Suggested Aminos
{
"api:statuscode":0,
"api:duration":"0.004s",
"api:message":"OK",
"communityList":[
{
"status":0,
"endpoint":"star-vs-as-forcas-do-mal-pt-br",
"name":"Star Vs As For\u00e7as Do Mal PT/BR",
"modifiedTime":"2016-11-01T01:04:54Z",

Best practices for building Vim plugins

2016-11-05 VimConf 2016

Parser

  • /src/parser/spider_monkey_ast.ml: The type definitions for the AST. Tries to stay very close to ESTree
  • /src/parser/lexer_flow.mll: The ocamllex lexer logic
  • /src/parser/parser_flow.ml: The recursive descent JS parser

Inference

  • /src/typing/type_inference_js.ml: Contains the "entry point" for inference (Function called infer_ast).
  • /src/typing/statement.ml: Most of the inference logic (runs through the AST and generates the initial constraints)
@vasanthk
vasanthk / System Design.md
Last active July 19, 2024 08:25
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@paulirish
paulirish / what-forces-layout.md
Last active July 18, 2024 22:41
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@insin
insin / Application.java
Created October 7, 2012 07:24
Play Framework + jade4j
package controllers;
import play.*;
import play.mvc.*;
public class Application extends JadeController {
public static Result index() {
return ok(render("index", "message", "Hello world!"));
}
}
@xdite
xdite / gist:3072362
Created July 8, 2012 19:10
deploy/asset.rb
# -*- encoding : utf-8 -*-
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb)
namespace :deploy do
namespace :assets do
desc <<-DESC
Run the asset precompilation rake task. You can specify the full path \
to the rake executable by setting the rake variable. You can also \
@domenic
domenic / portable-node.md
Created May 25, 2012 21:03
Tips for Writing Portable Node.js Code

Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.

Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.

Paths and URLs

On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation

@masaakif
masaakif / grep_menuitem.vim
Last active October 28, 2022 13:28 — forked from scrooloose/grep_menuitem.vim
nerdtree menu plugin to grep under selected directory. : Forked from http://gist.github.com/205807
"shove this in ~/.vim/nerdtree_plugin/grep_menuitem.vim
"
" Add 'g' menu items to grep under selected directory.
" 'g' : prompts the user to type search pattern under selected dir.
" use parent directory if file is selected.
" This uses ':grep'.
"
" For ripgrep user,
" NERDTreeRipGrepDirectory function is much, much faster.
" Requirements: