Skip to content

Instantly share code, notes, and snippets.

@pl12133
pl12133 / preact-upgrade-experience.md
Last active June 13, 2019 05:42
Preact@8 to Preact@10 Upgrade Notes

PreactX Upgrade Experience

Obvious breaking changes

See release 10.0.0-alpha.0 for a full list.

  • h -> createElement
  • VNode.nodeName -> VNode.type
  • VNode.attributes -> VNode.props
  • VNode.children -> VNode.props.children
@beginor
beginor / snowflake-id.sql
Last active May 11, 2024 18:48
Twitter Snowflake ID for PostgreSQL
CREATE SEQUENCE public.global_id_seq;
ALTER SEQUENCE public.global_id_seq OWNER TO postgres;
CREATE OR REPLACE FUNCTION public.id_generator()
RETURNS bigint
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
our_epoch bigint := 1314220021721;
seq_id bigint;
@singledigit
singledigit / cognito.yaml
Last active April 28, 2024 15:12
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@jatins
jatins / phineas-intro.md
Last active May 26, 2017 05:24
Building realtime application with DynamoDB (and potentially any database with an operation log)

Building realtime applications is hard.

A scalable solution to this problem involves many cumbersome steps:

  • Hooking into replication logs of the database servers, or writing custom data invalidating logic for realtime UI components.
  • Adding messaging infrastructure (e.g. RabbitMQ) to your project.
  • Writing sophisticated routing logic to avoid broadcasting every message to every web server.
  • Reimplementing database functionality in the backend if your app requires realtime computation (e.g. realtime leaderboards).

    All this requires enormous commitment of time and engineering resources.

- RethinkDB: Advancing the realtime web

@PurpleBooth
PurpleBooth / README-Template.md
Last active May 12, 2024 01:58
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@redism
redism / client.js
Created April 25, 2014 09:41
Simple socket.io server performance test
/**
* A simple socket.io client for performance benchmark
*
* Created by redism on 2014. 4. 22..
*/
var SocketIO = require('socket.io-client'),
argv = require('optimist').argv;
var n = argv.n || 10;
@refringe
refringe / sendy-server
Last active February 5, 2024 07:50
Nginx configuration file example for Sendy (http://sendy.co/).
server {
listen 80;
listen [::]:80;
server_name domain.com;
autoindex off;
index index.php index.html;
root /srv/www/domain.com/public;
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@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