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 / Convert String to slug.js
Created April 28, 2015 07:18
Convert a string to slug
function convertToSlug(Text)
{
return Text
.toLowerCase()
.replace(/[^\w ]+/g,'')
.replace(/ +/g,'-')
;
}
@mtinra
mtinra / CSS-only-Star-Rating.markdown
Created April 30, 2015 12:11
CSS-only Star Rating

CSS-only Star Rating

The goal was to create a radio button-powered star rating widget that uses CSS only. I wanted each star preceding the selected one to appear selected as well.

A Pen by Marcus Burnette on CodePen.

License.

@mtinra
mtinra / Responsive-Accordion-(Background-Images).markdown
Created April 30, 2015 12:24
Responsive Accordion (Background Images)
@mtinra
mtinra / page_jump_down.js
Created May 1, 2015 16:18
Scroll page to the position
// scroll down page away 500px from top
$(window).load(function() {
$("html, body").animate({ scrollTop: 500 }, 1000);
});
@mtinra
mtinra / CSS Tabs - Transitioning Between Variable Heights.markdown
Created July 7, 2015 13:23
CSS Tabs - Transitioning Between Variable Heights
@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
@mtinra
mtinra / wp-config.php
Last active November 24, 2015 11:18
Disable Post Revisions in Wordpress
<?php
/** Limit the number of post revisions */
define( 'WP_POST_REVISIONS', 5 );
/** Completely Disable Post Revisions */
define('WP_POST_REVISIONS', false );
/** Set Autosave Interval to 1 hour */
define('AUTOSAVE_INTERVAL', 3600 );
?>
wget http://wordpress.org/latest.tar.gz
tar xfz latest.tar.gz
mv wordpress/* ./
rmdir ./wordpress/
rm -f latest.tar.gz
@mtinra
mtinra / location
Last active December 14, 2015 19:08
Adobe Illustrator user preferences location
Windows: - C:\Users\<user name>\AppData\Roaming\Adobe\Adobe Illustrator 19 Settings\en_US\x64\
Mac OS :- Users\<user name>\library\preferences\Adobe Illustrator 19 Settings\en_US\
@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