This file contains hidden or 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 | |
| /** | |
| * Resize image class will allow you to resize an image | |
| * | |
| * Can resize to exact size | |
| * Max width size while keep aspect ratio | |
| * Max height size while keep aspect ratio | |
| * Automatic while keep aspect ratio | |
| */ | |
| class ResizeImage |
This file contains hidden or 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
| <script type='text/javascript' src='http://maps.google.com/maps/api/js?sensor=false'></script> | |
| <script type='text/javascript'> | |
| // <![CDATA[ | |
| var Mymap; | |
| var geocoder; | |
| var Latlng; | |
| var Options; | |
| var image; | |
| var cx = 0; | |
| var cy = 0; |
This file contains hidden or 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
| /** | |
| * Solution for unsupported browsers (create dummy image to get real dimensions): | |
| */ | |
| function realImgDimension(img) { | |
| var i = new Image(); | |
| i.src = img.src; | |
| return { | |
| naturalWidth: i.width, | |
| naturalHeight: i.height |
This file contains hidden or 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
| /** | |
| Reference: | |
| Theory: https://webkit.org/blog/4017/scroll-snapping-with-css-snap-points | |
| Examples: https://webkit.org/demos/scroll-snap | |
| plunker: https://plnkr.co/edit/gTxGcEanBRjl7badrjBS | |
| */ | |
| .parent{ | |
| -webkit-scroll-snap-type: mandatory; | |
| -webkit-scroll-snap-points-x: repeat(100%); | |
| } |
This file contains hidden or 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 initialize() { | |
| var map, map2; | |
| var styleArray = [ | |
| { | |
| featureType: "all", | |
| stylers: [ | |
| { saturation: -80 } | |
| ] | |
| },{ |
This file contains hidden or 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
| // <input ng-model='pat' ng-pattern='false' /> | |
| $scope.name=''; | |
| $scope.$watch('name', function() { | |
| $scope.name = $scope.name.toLowercase(); | |
| }); |
This file contains hidden or 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
| // <input ng-model="sth" ng-trim="false" custom-validation> | |
| app.directive('customValidation', function(){ | |
| return { | |
| require: 'ngModel', | |
| link: function(scope, element, attrs, modelCtrl) { | |
| modelCtrl.$parsers.push(function (inputValue) { | |
| var transformedInput = inputValue.toLowerCase().replace(/ /g, ''); |
This file contains hidden or 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
| Ref.: http://www.w3schools.com/tags/tag_meta.asp | |
| <!-- for Google --> | |
| <meta name="description" content="" /> | |
| <meta name="keywords" content="" /> | |
| <meta name="generator" content="" /> | |
| <meta name="author" content="" /> | |
| <meta name="copyright" content="" /> | |
| <meta name="application-name" content="" /> |
This file contains hidden or 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
| <!-- | |
| Parameters: | |
| url: document url (encode the url if it containes parameters, etc.), must be publicly available | |
| hl: language (ex: en, ar, bn etc.) | |
| embedded: embededable link, value true/false [MUST be used true to show] | |
| --> | |
| <iframe src="https://docs.google.com/viewerng/viewer?url=http://show.pdf&hl=bn&embedded=true"></iframe> |
This file contains hidden or 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 | |
| // Ref.: http://php.net/manual/en/function.curl-getinfo.php | |
| // http://www.hackingwithphp.com/15/10/2/your-first-curl-scripts | |
| //step1 | |
| $cSession = curl_init(); | |
| //step2 | |
| curl_setopt($cSession,CURLOPT_URL,"http://www.google.com/search?q=curl"); | |
| curl_setopt($cSession,CURLOPT_RETURNTRANSFER,true); | |
| curl_setopt($cSession,CURLOPT_HEADER, false); | |
| //step3 |