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
-- phpMyAdmin SQL Dump | |
-- version 3.4.5deb1 | |
-- http://www.phpmyadmin.net | |
-- | |
-- Host: localhost | |
-- Generation Time: Nov 24, 2011 at 04:54 PM | |
-- Server version: 5.1.58 | |
-- PHP Version: 5.3.6-13ubuntu3.2 | |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
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
-- phpMyAdmin SQL Dump | |
-- version 3.4.5deb1 | |
-- http://www.phpmyadmin.net | |
-- | |
-- Host: localhost | |
-- Generation Time: Jan 05, 2012 at 04:54 PM | |
-- Server version: 5.1.58 | |
-- PHP Version: 5.3.6-13ubuntu3.3 | |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
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
//when you do this: | |
elem.innerHTML = 'I want to set elem\'s text!'; | |
//you're calling the browser's html parser. why so surprised? innerHTML takes an html string and turns it into DOM elements. | |
//you can't do that without calling an html parser. | |
//after the browser is done parsing your (invalid) html, it sees that it only contains text and _assumes_ you just want text and puts it into | |
//a text node. | |
//now what? it empties the element out of everything and appends the new text node. it then re-parses, re-flows and re-paints your entire page | |
// (since your innerHTML call can do many other things, and affect everything else in the page) |
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
class Bootstrap { | |
function __construct() { | |
$url = isset($_GET['url']) ? explode('/', rtrim($_GET['url'], '/')) : null; | |
if( empty($url[0]) ) { | |
$url[0] = 'index'; // default value | |
} |
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
public function updateItem($id, $map, $groups) { | |
$this->updateData('inventory', $id, $map); // I update all the columns in the item table | |
$dbo = $this->db->exec('DELETE FROM group_item_mapping WHERE item_id = ' . $id); // here is where I remove the group enrollments. | |
for($i = 0, $l = count($groups); $i < $l; $i++) { | |
// here I re-add the enrollments for the selected checkbox options. | |
$this->addData('INSERT INTO group_item_mapping (item_id, group_id) VALUES (:item_id, :group_id)', array( ':item_id' => $id, ':group_id' => $groups[$i] )); | |
} | |
} |
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
http://stackoverflow.com/a/8417913/829835 [Class vs. ID - Readability] |
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
function codeRunner(){ | |
var cb = document.getElementById("checkbox"), ppab = document.getElementById("ppa-box"); // checkbox is used twice, no need to select it twice. Same for ppa-box (referenced three times, called twice) | |
// Unlock PPA when Checkbox is ticked | |
cb.onclick = function(){ | |
if(cb.checked){ | |
ppab.disabled=false; | |
} | |
else | |
{ | |
ppab.disabled=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
@Raynos | |
("textContent" in Element.prototype) || Object.defineProperty(Element.prototype, "textContent", { | |
get: function () { return this.innerText; }, | |
set: function (v) { this.innerText = v; } | |
}); | |
@Zirak | |
var getText = (function () { | |
var textProp = 'textContent' in document.createElement( 'div' ) ? 'textContent' : 'innerText'; |
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
// Embed the CSS | |
function injectCSS(rulez) { | |
var style = document.createElement('style'); | |
style.type = 'text/css'; | |
style.innerHTML = rulez; | |
document.head.appendChild(style); | |
} | |
// Embed the Script tags | |
function injectScript(url) { | |
var script = document.createElement('script'); |
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
/* | |
ββββββββββββββββββββββββββββββββββββββββββββββββββ | |
ββββββββββββββββββββββββββββββββββββββββββββββββββ | |
ββββββββββββββββββββββββββββββββββββββββββββββββββ | |
ββββββββββββββββββββββββββββββββββββββββββββββββββ | |
*/ |