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 contains(a, obj) | |
{ | |
var i = a.length; | |
while (i--) | |
{ | |
if (a[i] === obj) | |
{ | |
return true; | |
} | |
} |
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
//push branch to origin | |
git push -u origin mynewfeature | |
//create and checkout branch named hotfix | |
git checkout -b hotfix | |
//merge | |
git checkout master | |
git merge hotfix |
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
http://lorempixel.com/g/400/200/people/7/ |
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
$.ajaxSetup( | |
{ | |
error: function(jqXHR, exception) | |
{ | |
if (jqXHR.status === 0) | |
{ | |
alert('Not connect.\n Verify Network.'); | |
} | |
else if (jqXHR.status === 404) | |
{ |
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
.module { | |
overflow-y: scroll; /* has to be scroll, not auto */ | |
-webkit-overflow-scrolling: touch; | |
} |
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
/*iPhone < 4:*/ | |
@media screen and (device-aspect-ratio: 2/3) {} | |
/*iPhone 4 retina */ | |
@media screen and (device-aspect-ratio: 2/3) and (-webkit-min-device-pixel-ratio: 2) {} | |
/*iPhone 5:*/ | |
@media screen and (device-aspect-ratio: 40/71) {} | |
/*iPad:*/ |
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
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes"> | |
<link rel="stylesheet" type="text/css" href="normalize.css"> | |
<link rel="stylesheet" type="text/css" href="main.css"> | |
</head> |
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 get_string_between($string, $start, $end){ | |
$string = " ".$string; | |
$ini = strpos($string,$start); | |
if ($ini == 0) return ""; | |
$ini += strlen($start); | |
$len = strpos($string,$end,$ini) - $ini; | |
return substr($string,$ini,$len); | |
} | |
$fullstring = "this is my [tag]dog[/tag]"; |
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
CREATE TABLE wp_posts_BAK LIKE wp_posts ; | |
INSERT wp_posts_BAK SELECT * FROM wp_posts; | |
CREATE TABLE wp_postmeta_BAK LIKE wp_postmeta ; | |
INSERT wp_postmeta_BAK SELECT * FROM wp_postmeta; |
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
document.body.addEventListener('touchmove', function(event) { | |
event.preventDefault(); | |
}, false); | |
// http://www.html5rocks.com/en/mobile/touch/ |