This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/ | |
// Trim | |
String.prototype.trim = function(){ | |
return this.replace(/^\s+|\s+$/g, ""); | |
}; | |
// Camel Case | |
String.prototype.toCamel = function(){ | |
return this.replace(/(\-[a-z])/g, function($1){return $1.toUpperCase().replace('-','');}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* jQuery lightweight plugin boilerplate | |
* Original author: @ajpiano | |
* Further changes, comments: @addyosmani | |
* Licensed under the MIT license | |
*/ | |
// the semi-colon before the function invocation is a safety | |
// net against concatenated scripts and/or other plugins | |
// that are not closed properly. |
##How to save your Facebook Lookback video #####ratiw (Jan. 1, 2015)
- You need to use Google Chrome Browser
- Open a new tab in Chrome and type the following in the address bar
chrome://cache
-
Open another tab and go to your www.facebook.com/lookback
-
Select HD quality by clicking at the HD icon on the lower-right of the video and let the video play for a few seconds, then switch back to previous tab (the chrome://cache)
- Create new project
composer create-project laravel/laravel l5-view dev-develop
l5-view
is the project folder name.
- Add new project site to nginx
serve l5-view.app /home/vagrant/Code/l5-view/public
My homestead
VM used to be in D:\www\Homestead
and all projects lived inside its folder. I want to update homestead
to the updated version and separate my projects to a new folder (e.g. D:\www\projects), so that I do not acidentally delete them when I need to delete Homestead folder.
-
Update Homestead box. From command prompt, run
vagrant box update
-
Create a new folder for Projects. (D:\www\projects)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Convert number amount to Thai text as in Excel | |
* | |
* author: Rati Wannapanop | |
* email: [email protected] | |
* since: 2014-09-06 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services; | |
class InvalidPatternException extends \Exception | |
{ | |
} | |
/** | |
* Pattern is enclosed in the open and close delimiter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function str_replace(search, replace, subject) { | |
var result = subject; | |
for (var i = 0; i < search.length; i++) { | |
result = result.replace(search[i], replace[i]); | |
} | |
return result; | |
} |