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 / 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 / .htaccess
Created March 17, 2017 17:40 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@mtinra
mtinra / gist:23658af563742d487005
Created February 16, 2016 05:10 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@mtinra
mtinra / laravel5_shared_hosting_project.sh
Created January 18, 2016 20:28 — forked from meganlkm/laravel5_shared_hosting_project.sh
setup a laravel5 project to deploy to a shared hosting provider
#!/bin/bash
myproject='myproject'
mywww='public_html'
# initialize project
composer create-project laravel/laravel $myproject --prefer-dist
cd $myproject
# fix paths to public
@mtinra
mtinra / OpenWithSublimeTextAsAdmin.bat
Last active September 20, 2015 11:53 — forked from jcppkkk/OpenWithSublime.bat
Add context menu to allow user open file or folder with Sublime as User or Admin. Save the raw file OpenWithSublimeTextAsAdmin.bat into sublime folder and execute it.
@echo off
@rem \"%stPath%\" : Path to Sublime Text installation dir.
@rem %UserEntry%: Key name for the registry entry.
@rem %UserMenuText% : Context menu text. Set your preferred menu text (e.g.: translate to your language).
@rem %AdminEntry%: Key name for the registry entry.
@rem %AdminMenuText% : Context menu text. Set your preferred menu text for administrator privilege (e.g.: translate to your language).
SET stPath=%~dp0sublime_text.exe
SET UserEntry=Sublime Text
SET AdminEntry=Sublime Text As Admin