Skip to content

Instantly share code, notes, and snippets.

View mtinra's full-sized avatar

Mana Tinratreengam mtinra

  • Phuket, Thailand
View GitHub Profile
@mtinra
mtinra / README.md
Created August 3, 2019 02:50 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@mtinra
mtinra / index.js
Last active May 2, 2019 09:13
basic express server with CORS header
const express = require("express");
const app = express();
const port = process.env.SERVER_PORT || 3000;
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header(
"Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type, Accept"
);
@mtinra
mtinra / index.html
Last active May 2, 2019 07:19
XMLHttpRequest for CORS
<script>
const request = new XMLHttpRequest();
const url = 'https://www.google.co.th/';
function CORSTesting() {
if(request) {
request.open('GET', url, true);
request.send();
}
}
@mtinra
mtinra / cognito.yaml
Last active May 14, 2021 16:02 — forked from singledigit/cognito.yaml
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
API_ID:
Type: String
Despription: API Gateway ID
@mtinra
mtinra / grid-pile-stacking-css-grids-for-impossible-layouts.markdown
Created June 3, 2018 03:15
GRID PILE: Stacking CSS Grids for Impossible Layouts
@mtinra
mtinra / center-everything.css
Last active June 2, 2018 10:17
CSS Flexbox
.container {
display: flex;
align-items: center;
justify-content: center;
}
@mtinra
mtinra / .env
Last active August 11, 2017 10:13
Sequelize config files for connect to SSL server at Heroku progresql
DATABASE_PATH = postgres://user:pass@localhost:5432/dbname
@mtinra
mtinra / async.js
Last active July 31, 2017 08:57
Async Await sample with fetch function
// Fetch is return promise
// function fetchAlmbums() {
// fetch('http://rallycoding.herokuapp.com/api/music_albums')
// .then(res => res.json())
// .then(json => console.log(json));
// }
// fetchAlmbums();
const fetchAlmbums = async () => {
@mtinra
mtinra / vuebar.md
Created July 22, 2017 05:16
Vuebar