Skip to content

Instantly share code, notes, and snippets.

View sators's full-sized avatar
🤓

Sators sators

🤓
View GitHub Profile
@johnrichardrinehart
johnrichardrinehart / webpack-dev-server_output
Created November 27, 2020 10:17
webpack-dev-server doesn't accept contentBase as a valid field
/home/john/Downloads/repos/project/app/.yarn/cache/schema-utils-npm-3.0.0-e97702da81-a084f593f2.zip/node_modules/schema-utils/dist/validate.js:104
throw new _ValidationError.default(errors, schema, configuration);
^
ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
- configuration has an unknown property 'contentBase'. These properties are valid:
object { bonjour?, client?, compress?, dev?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, injectClient?, injectHot?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, openPage?, overlay?, port?, proxy?, public?, setupExitSignals?, static?, stdin?, transportMode?, useLocalIp? }
at validate (/home/john/Downloads/repos/project/app/.yarn/cache/schema-utils-npm-3.0.0-e97702da81-a084f593f2.zip/node_modules/schema-utils/dist/validate.js:104:11)
at new Server (/home/john/Downloads/repos/project/app/.
@jrapala
jrapala / normalize.ts
Last active July 6, 2023 12:26
Normalize React Native font sizes
// How to use:
//
// StyleSheet or inline styles:
// fontSize: normalize(15),
//
// styled-components:
// font-size: ${normalize(15) + "px"};
import { Dimensions, Platform, PixelRatio } from "react-native"
@plindberg
plindberg / README.md
Created August 5, 2017 16:46
How to set up an AWS Lambda function for returning S3 pre-signed URLs for uploading files.

README

Granted, this is little more than an obfuscated way of having a publicly writable S3 bucket, but if you don’t have a server which can pre-sign URLs for you, this might be an acceptable solution.

For this to work, you take the following steps:

  1. Create a Lambda func, along with a new IAM role, keeping the default code.
  2. Create an API in the API Gateway.
@nrollr
nrollr / Node_AWS_Linux.md
Last active May 7, 2023 14:18
Install Node.js on Amazon Linux (EC2)

Installing Node.js on Amazon Linux AMI

The following will guide you through the process of installing Node.js on an AWS EC2 instance running Amazon Linux AMI 2016.09 - Release Notes

For this process I'll be using a t2.micro EC2 instance running Amazon Linux AMI (ami-d41d58a7). Once the EC2 instance is up-and-running, connect to your server via ssh

@benhodgson87
benhodgson87 / decimalFormat.js
Last active November 8, 2020 18:11
DecimalFormat Currency Formatting
Number.prototype.currency = function (format) {
var amt = this, neg;
// If no formatting string supplied
// or amount is not a number, return as is
if (!format || isNaN(amt)) return amt;
// Extract placeholders from format string
var formFig = format.match(/\#(.*)\#/g).pop();
@oodavid
oodavid / README.md
Created March 26, 2012 17:05
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc