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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content="Short example on using indexedDB with jquery mobile - last updated: May 2012"> | |
<meta name="author" content="Ido Green"> | |
<title>IndexedDB with JQM</title> |
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 | |
* This demo is partly based on a post by Anthony Sterling on the sitepoint forum. | |
* It is partly based on a video by John Lebensold of killerphp.com | |
* | |
* http://www.sitepoint.com/forums/showthread.php?t=636303 | |
* | |
* AnthonySterling | |
* Twitter: @AnthonySterling | |
* | |
* Here's a rather ridiculous, yet interesting way to use __call. |
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
//Select class selector | |
//select option by index | |
$('#frakt_type option:eq(0)').prop("selected",true); | |
//select option by value | |
$('#frakt_type option[value="'+4+'"]').prop("selected",true); | |
//Select option by contains | |
$('#frakt_type option:contains("find_text")').prop("selected",true); |
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
Google Suggestion | |
//Old format | |
http://suggestqueries.google.com/complete/search?hl=sv&output=toolbar&q=vxthus | |
//new format | |
http://clients1.google.com/complete/search?hl=sv&output=toolbar&q=vxthus | |
//Suspicious | |
https://www.google.se/complete/search?client=psy-ab&hl=en-IN&tok=0&q=droppslanga |
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
# | |
# Apache/PHP/Drupal settings: | |
# | |
# Protect files and directories from prying eyes. | |
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$"> | |
Order allow,deny | |
</FilesMatch> | |
# Don't show directory listings for URLs which map to a directory. |
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
header('Content-Type: image/png'); | |
$modified = $ch->lastmodified(); | |
if($modified) | |
{ | |
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $modified) | |
{ | |
header('HTTP/1.0 304 Not Modified'); exit(); | |
} | |
//echo $modified; | |
header('Last-Modified: ' .gmdate('D, d M Y H:i:s T', $modified).' GMT'); |
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
-- --------------------------------------------------------------------------- | |
-- Levenshtein distance | |
-- from the Artful Common Queries page | |
-- http://www.artfulsoftware.com/infotree/qrytip.php?id=552 | |
-- --------------------------------------------------------------------------- | |
-- The Levenshtein distance between two strings is the minimum number of | |
-- operations needed to transform one string into the other, where an operation | |
-- may be insertion, deletion or substitution of one character. |
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
//Download remote file | |
function getUrlFile($url, $path) | |
{ | |
$newfilename = $path; | |
$file = fopen($url, "rb"); | |
if ($file) { | |
$newfile = fopen($newfilename, "wb"); | |
if ($newfile) | |
while (!feof($file)) { | |
fwrite($newfile, fread($file, 1024 * 8), 1024 * 8); |
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
document.getElementById("header").style.top = 0; | |
var prevScrollpos = window.pageYOffset; | |
window.onscroll = function() { | |
document.getElementById("header").style.position = 'fixed'; | |
var currentScrollPos = window.pageYOffset; | |
var htop = parseInt(document.getElementById("header").style.top); | |
var menuHeight = $('header').outerHeight()+5; | |
if (prevScrollpos > currentScrollPos) { | |
htop = htop +3; |
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
.wrap | |
{ | |
height: 100%; | |
width: 100%; | |
position: fixed; | |
padding-top: 104px; | |
left: 0; | |
z-index: 99; | |
top:-100%; | |
} |