A list of commonly used GIT commands.
git clone https://github.com/user/repo.git
| // VIEWPORT FIX | |
| documentWidth = $(document).width(); | |
| if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) { | |
| viewport = document.querySelector("meta[name=viewport]"); | |
| viewport.setAttribute('content', 'width=' + documentWidth); | |
| } |
| function GetIP() | |
| { | |
| foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) | |
| { | |
| if (array_key_exists($key, $_SERVER) === true) | |
| { | |
| foreach (array_map('trim', explode(',', $_SERVER[$key])) as $ip) | |
| { | |
| if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) | |
| { |
| <?php | |
| /** | |
| * Youtube API get thumbnail using Youtube username | |
| * @param mixed $client Youtube username | |
| * @return mixed Thumbnail src attribute | |
| */ | |
| public static function get_yt_thumbnail($client) | |
| { | |
| $feed1 = 'https://gdata.youtube.com/feeds/api/users/'.$client.'? fields=media:thumbnail'; |
| <?php | |
| /** | |
| * Display time ago | |
| * @param mixed $time strtotime of timestamp | |
| * @return mixed string containing time ago since passed param | |
| */ | |
| public static function time_ago($time) | |
| { | |
| $periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade"); |
| <?php $IE6 = (ereg('MSIE 6',$_SERVER['HTTP_USER_AGENT'])) ? true : false; | |
| $IE7 = (ereg('MSIE 7',$_SERVER['HTTP_USER_AGENT'])) ? true : false; | |
| $IE8 = (ereg('MSIE 8',$_SERVER['HTTP_USER_AGENT'])) ? true : false; | |
| if (($IE6 == 1) || ($IE7 == 1) || ($IE8 == 1)) { | |
| // Do fallback stuff that old browsers can do here | |
| echo "Shit its ie!"; | |
| } else { ?> | |
| // do stuff that real browsers can handle here |
| <? | |
| /************************************************************* | |
| Sitemap Crawler and Generator | |
| *************************************************************/ | |
| $file = "google.xml"; // output file | |
| $url = "http://www.plop.at"; // url to scan |
This list contains the top 10 HTTP Status codes that are most popular
| Code | Name | Usage |
|---|---|---|
| 200 | OK | A successful GET or PUT request |
| 201 | Created | A successful POST request |
| 204 | No content | A successful DELETE request |
| 400 | Bad request | An unsuccessful GET, POST, or PUT request, due to invalid content |
| /** | |
| * Parse url | |
| * @param {string} url Url string | |
| * @return {object} Parsed url object | |
| * | |
| * Example Use: | |
| * var parsedUrl = parseURL('http://drive.google.com/search'); | |
| * | |
| * parsedUrl { | |
| * domain: "drive.google.com", |