Skip to content

Instantly share code, notes, and snippets.

View af's full-sized avatar
🤔
...

Aaron Franks af

🤔
...
View GitHub Profile
" Navigating between buffers:
map! <C-k> <esc>:bp<CR>
map <C-k> :bp<CR>
map! <C-l> <esc>:bn<CR>
map <C-l> :bn<CR>

Dan Dan noodles

  • 4 wrapped packages of soba noodles. There are usually 3 in a big package
  • 1/2 cucumber
  • 1 red pepper
  • 3 medium carrots
  • 2/3 cup chopped cilantro
  • 2/3 cup chopped thai basil

For sauce

@af
af / components.md
Last active January 25, 2016 21:28
Presentational/Container components: are these terms misleading?

Presentational/Container have long been suggested as terms to describe two different classes of React components. However I think these terms are a bit deceptive, and don't accurately represent the differences between them:

Presentational components

  • can "contain" other components, thus they also act as containers
  • not concerned merely with "presentation" (in the same way that CSS is)

Container components

  • do more than simply "contain" other components. Containing other components is not what makes them unique
  • have an active role in accessing and mutating the state of your application. This is what differentiates
@af
af / postgres_queries_and_commands.sql
Created October 11, 2019 21:03 — forked from josescasanova/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@af
af / debug-scroll.md
Created February 8, 2023 19:50 — forked from cuth/debug-scroll.md
Find the elements that are causing a horizontal scroll. Based on http://css-tricks.com/findingfixing-unintended-body-overflow/

Debug Horizontal Scroll

(function (d) {
    var w = d.documentElement.offsetWidth,
        t = d.createTreeWalker(d.body, NodeFilter.SHOW_ELEMENT),
        b;
    while (t.nextNode()) {
        b = t.currentNode.getBoundingClientRect();
 if (b.right &gt; w || b.left &lt; 0) {