Skip to content

Instantly share code, notes, and snippets.

@axpro
axpro / fonts.md
Created May 17, 2023 08:41 — forked from jaames/fonts.md
Cool free/cheap font foundries
@axpro
axpro / what-forces-layout.md
Created July 4, 2017 12:42 — forked from paulirish/what-forces-layout.md
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.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@axpro
axpro / plugins.md
Created July 17, 2016 08:43
Guidelines for using plugins to organize your hapi application

This document outlines the proper way of using plugins in a hapi-based application. By "proper" I mean "as designed". Of course you can do whatever you want in your code and there are many other patterns you can choose or develop, but this is what I had in mind when I designed the plugin system and as I continue to evolve it.

This document is a work-in-progress and only half-way done. It should probably move to a page on the hapijs.com site if someone wants to do the proofing work and submit it. I got bored writing it so will probably never finish it.

When should I organize my code using plugins?

Always.

Every hapi application should be implemented inside a plugin. This provides an easy path for extensibility and isolates your code from other plugins you are likely to use (e.g. inert for services static files, vision for template rendering, etc.). It also allows you to use more advace tools such as [glue](https://github.com/hapijs/g

@axpro
axpro / promisesEM.md
Created February 29, 2016 07:32 — forked from dmvaldman/promisesEM.md
Promises as EventEmitters

Promises as EventEmitters

I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.

I read the spec, some blog posts, and looked through some code. I learned how to

@axpro
axpro / formfields.html
Created October 9, 2015 14:58 — forked from wboykinm/formfields.html
Google forms hidden fields
<!-- ADD GOOGLEFORM-RELATED INPUTS HERE, ALL HIDDEN.
THEY'LL BE GIVEN VALUES IN THE SCRIPT BELOW
THE "NAME" AND "ID" PARAMETERS MUST CORRESPOND TO
THOSE IN THE SOURCE OF THE GOOGLE-HOSTED LIVE FORM-->
<!-- QUESTION 1 -->
<input type="hidden" name="entry.338471973" value="" id="entry_338471973">
<!-- QUESTION 2: LAT/LONG -->
<input type="hidden" name="entry.80388879" value="" id="entry_80388879">

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@axpro
axpro / rejoice.md
Last active August 29, 2015 14:24 — forked from dstevensio/rejoice.md

Brand new project, create dirs "lib/modules", "lib/templates", "config"

lib/modules/home/index.js :

exports.register = function (server, options, next) {

  server.route({
    path: '/',
 method: 'GET',

#String utility functions (yes, functions)

version:  1.03
author:   Simon de Turck
email:    simon@zimmen.com

This utility:

  • is created for use in Symphony-CMS. The XSLT-powered open source content management system.
  • uses some EXSLT that is supported in libxslt 1.0.19 and later
@axpro
axpro / 0_reuse_code.js
Created February 27, 2014 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console