Skip to content

Instantly share code, notes, and snippets.

Mana Tinratreengam mtinra

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

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
basic express server with CORS header
View index.js
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
XMLHttpRequest for CORS
View index.html
<script>
const request = new XMLHttpRequest();
const url = 'https://www.google.co.th/';
function CORSTesting() {
if(request) {
request.open('GET', url, true);
request.send();
}
}
View Find and replace in chrome dev tool.md
@mtinra
mtinra / cognito.yaml
Last active Jun 23, 2018 — forked from singledigit/cognito.yaml
Create a Cognito Authentication Backend via CloudFormation
View cognito.yaml
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 Jun 3, 2018
GRID PILE: Stacking CSS Grids for Impossible Layouts
View grid-pile-stacking-css-grids-for-impossible-layouts.markdown
View center-everything.css
.container {
display: flex;
align-items: center;
justify-content: center;
}
@mtinra
mtinra / .env
Last active Aug 11, 2017
Sequelize config files for connect to SSL server at Heroku progresql
View .env
DATABASE_PATH = postgres://user:pass@localhost:5432/dbname
@mtinra
mtinra / async.js
Last active Jul 31, 2017
Async Await sample with fetch function
View async.js
// 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 () => {
View vuebar.md
You can’t perform that action at this time.