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
// save the new list locally | |
function saveLocally(dataToSave){ | |
var cleanData = JSON.stringify({dataToSave: dataToSave}); // generate clean data | |
localStorage.setItem("data", cleanData); // save new data locally | |
showListItems(); // refresh the list display | |
showLocalData(); // update localdata display | |
} |
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
window.addEventListener("DOMContentLoaded", loadSavedData, false);// load locally saved data when the page opens | |
// get the locally saved data | |
function loadSavedData(){ | |
savedData = localStorage.getItem("data"); // get data from local storage | |
if (savedData && savedData != null) { // if not empty | |
savedData = JSON.parse(savedData); // get data from returned json string | |
savedData = savedData['dataToSave']; // set savedData from dataToSave item | |
showListItems();// Generate the list items and display |
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 manifest="wsdemo.manifest"> | |
<head> | |
<meta name="viewport" content="width=device-width"> |
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
$config= array( | |
'default' => array( | |
'host' => '127.0.0.1', | |
'port' => 11211, | |
'weight' => 80 | |
), | |
'server_1' => array( | |
'host' => '127.0.0.2', | |
'port' => 11211, | |
'weight' => 50 |
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
$cachetime = 10; // number of seconds to cache for | |
$data = array(); | |
$data['cachereset'] = 0; | |
// cache calls | |
$startTime = microtime(true); | |
$this->load->driver('cache'); | |
$cache = $this->cache->memcached->get('alluserscount'); | |
if (!$cache){ | |
$data['cachereset'] = 1; |
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
$memcache = new Memcache; | |
$memcache->connect("localhost",11211); | |
echo "Server's version: " . $memcache->getVersion() . "<br />\n"; | |
$data = 'This is working'; | |
$memcache->set("key",$data,false,10); | |
echo "cache expires in 10 seconds<br />\n"; | |
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
#!/usr/bin/python | |
import subprocess | |
import time | |
import urllib | |
import usblamp | |
import signal | |
import sys |
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
#!/usr/bin/python | |
import subprocess | |
import time | |
import usblamp | |
checkTime = 1 | |
arr = ("white", "yellow", "red", "blue", "green") | |
for i in arr: |
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
127.0.0.1 example1.sdev |
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
<VirtualHost *:80> | |
DocumentRoot "c:/wamp/www/example1.sdev/" | |
ServerName example1.sdev | |
<directory "c:/wamp/www/example1.sdev/"> | |
Options Indexes FollowSymLinks | |
AllowOverride all | |
Order Deny,Allow | |
Deny from all | |
Allow from 127.0.0.1 | |
</directory> |