Skip to content

Instantly share code, notes, and snippets.

@salipro4ever
salipro4ever / setup ormauth fuelphp.md
Last active February 25, 2016 15:44 — forked from asilbalaban/setup.md
How to install fuelphp and setup ormauth on it!

Installing and Setup FuelPHP's Ormauth

Create new project with Oil

$ oil create <project_name>

In your project there is a fuel/packages folder Copy /fuel/packages/auth/config/auth.php and /fuel/packages/auth/config/ormauth.php files to your main config folder which is /fuel/app/config/

return array(
'required' => "is required",
'equals' => "must be the same as '%s'",
'different' => "must be different than '%s'",
'accepted' => "must be accepted",
'numeric' => "must be numeric",
'integer' => "must be an integer (0-9)",
'length' => "must be longer than %d",
'min' => "must be at least %s",
'max' => "must be no more than %s",
patterns : {
alpha: /^[a-zA-Z]+$/,
alpha_numeric : /^[a-zA-Z0-9]+$/,
integer: /^[-+]?\d+$/,
number: /^[-+]?[1-9]\d*$/,
// amex, visa, diners
card : /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,
cvv : /^([0-9]){3,4}$/,
Detector = {
canvas : !! window.CanvasRenderingContext2D,
webgl : ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(),
workers : !! window.Worker,
fileapi : window.File && window.FileReader && window.FileList && window.Blob,
@salipro4ever
salipro4ever / VN2url
Created June 9, 2015 17:25
Convert vn language to url
<script type="text/javascript">
function locdau(){
//code by Minit - www.canthoit.info - 13-05-2009
var str = (document.getElementById("title").value);
str= str.toLowerCase();
str= str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g,"a");
str= str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g,"e");
str= str.replace(/ì|í|ị|ỉ|ĩ/g,"i");
str= str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g,"o");
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>

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

/*==================================================
= First Web by Salipro =
==================================================*/
/* Extra Large Devices, FHD Screens */
@media only screen and (min-width: 1400px){
}
/* Large Devices, Wide Screens */