Skip to content

Instantly share code, notes, and snippets.

View amadeomano's full-sized avatar
:fishsticks:
Building the blocks

Amadeo Manouchehri amadeomano

:fishsticks:
Building the blocks
View GitHub Profile
@swyxio
swyxio / Gatsby-bootstrap-lifecycle.md
Last active April 1, 2022 11:19
Gatsby bootstrap lifecycle

Sequence of Gatsby's bootstrap lifecycle with links to source code as of v2.0.0

  1. open and validate gatsby-config (get-config-file.js) 1.5 load themes (swyx added this note July 2019)
  2. load plugins (load-plugins/index.js) from the list given in gatsby-config.js
  3. onPreBootstrap: runs onPreBootstrap if it is implemented in any plugins, for example gatsby-plugin-typography. Receives handy [apiCallArgs](https://github.com/gatsbyjs/gatsby/blob/ffd8b2d691c9
@adamtester
adamtester / laravel_compress.php
Created January 15, 2015 11:16
laravel_compress
App::after(function($request, $response)
{
// Compress output
ini_set("pcre.recursion_limit", "16777");
$buffer = $response->getContent();
$re = '%# Collapse whitespace everywhere but in blacklisted elements.
(?> # Match all whitespans other than single space.
[^\S ]\s* # Either one [\t\r\n\f\v] and zero or more ws,
| \s{2,} # or two or more consecutive-any-whitespace.
) # Note: The remaining regex consumes no text at all...
@hubgit
hubgit / download-media-rss.php
Created July 10, 2012 09:48
Download media files from an RSS feed
<?php
$feed = 'https://www.box.com/shared/58ee78a0c5a9cfcf5cfc/a34f97e67c/rss.xml';
$dom = new DOMDocument();
$dom->load($feed);
$xpath = new DOMXPath($dom);
$xpath->registerNamespace('media', 'http://search.yahoo.com/mrss/');
$nodes = $xpath->query('channel/item');

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: