Skip to content

Instantly share code, notes, and snippets.

View robertu7's full-sized avatar
🏁
#0d6763, #c0a46b

robertu robertu7

🏁
#0d6763, #c0a46b
View GitHub Profile
@nepsilon
nepsilon / http-methods-it-s-not-only-about-get-and-post.md
Last active July 18, 2020 00:35
HTTP methods: It’s not only about GET and POST — First published in fullweb.io issue #76

HTTP methods: It’s not only about GET and POST

HTML forms let us only use GET and POST methods, but HTTP provides us with more:

  • HEAD It works like GET but will not return the body. Useful for checking if the resource is 404 or has been updated (via caching headers).

  • PUT A way for HTTP to tell "create or update if exist" the resource at this URL with my payload.

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@adewale
adewale / gist:6e2baa8fdea65108b257fe9fbdae3b77
Created August 23, 2016 15:10
Common misconceptions about Progressive Web Apps
Common misconceptions about Progressive Web Apps
They have to be SPAs.
They have to live at pwa.*.com
They have to be mobile only.
They're not allowed to be responsive.
They have to use material design.
They only work in chrome.
They don't work in safari or on iOS.
They have to look like your android app.
@rstacruz
rstacruz / bundle-js.md
Last active March 15, 2021 05:46
bundle-js

bundle-js

Batteries-included, minimal-configuration JS bundler

A hypothetical JavaScript bundler. bundle-js aims to be your one-stop-shop for everything in the JS frontend. Goals:

  • Batteries-included: you should be able to use bundle-js without any plugins or any fancy configuration.
  • Convention over configuration: there should be little need to configure bundle-js.
  • One dependency: no more dealing with webpack, loaders, babel, babel presets, babel plugins, and so on!
  • Extensible: it should still be possible to extend functionality if necessary.

architectures and whatnot

  1. plain ol' React
let state = initial
render(view(state), element)
  • view is pure!

The issue:

..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.

(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)

touch-action CSS property can be used to disable this behaviour.

touch-action: manipulation The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.

sudo yum -y install gcc gcc-c++ kernel-devel
sudo yum -y install python-devel libxslt-devel libffi-devel openssl-devel
pip install cryptography
@Couto
Couto / webpack.js
Last active November 7, 2024 13:10
Fetch polyfill with webpack
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var folders = {
APP: path.resolve(__dirname, '../app'),
BUILD: path.resolve(__dirname, '../build'),
BOWER: path.resolve(__dirname, '../bower_components'),
NPM: path.resolve(__dirname, '../node_modules')
};
@sebmarkbage
sebmarkbage / Enhance.js
Last active February 10, 2025 06:23
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {