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
var timings = document.querySelectorAll("#rhtable tr > td:nth-of-type(4)"); | |
var totalHours = 0; | |
for (var i = 0; i < timings.length; i++) { | |
var timing = timings[i].innerHTML.split(":"); | |
totalHours += parseFloat(timing[0]) + (parseFloat(timing[1]) / 60) + (parseFloat(timing[1]) / 3600); | |
} | |
alert("Hours watched: " + totalHours); |
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
// We just need to check if the IFrame origin is from discus.com | |
if (location.hostname.indexOf('.disqus.com') != -1) { | |
// Extract the textarea (there must be exactly one) | |
var commentBox = document.querySelector('#comment'); | |
if (commentBox) { | |
// Inject some text! | |
commentBox.innerText = 'Google Chrome Injected!'; | |
} | |
} |
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> | |
<script> | |
chrome.browserAction.onClicked.addListener(function(tab) { | |
chrome.tabs.sendRequest(tab.id, {method: "getLocalStorage"}, function(response) { | |
var myObjectRetrieved = JSON.parse(response.data); | |
console.log(myObjectRetrieved); | |
}); | |
}); | |
// Automatically inject all pages with the content script when the extension |
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
alert('Hello!'); |
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 simulateClick(element) { | |
var clickEvent = document.createEvent("MouseEvents") | |
clickEvent.initEvent("mousedown", true, true) | |
element.dispatchEvent(clickEvent); | |
clickEvent = document.createEvent("MouseEvents") | |
clickEvent.initEvent("click", true, true) | |
element.dispatchEvent(clickEvent); | |
clickEvent = document.createEvent("MouseEvents") |
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 | |
@UserBit_50 = | |
IFNULL( | |
convert(profilevalue_50, unsigned) | |
,0 | |
) | |
FROM | |
se_profilevalues | |
WHERE | |
profilevalue_user_id = 1; |
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 | |
@UserBit_50 as 'UserBit_50 (This Should not Be Null!)', | |
SUM( | |
( | |
convert( IFNULL(profilevalue_50, 0) , unsigned ) & | |
40988 /*@UserBit_50*/) > 0 | |
) / ( | |
SELECT COUNT(*) FROM se_profilevalues | |
) AS 'Avg Intersection' | |
FROM |
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 5.1 Acronym Definition Class | |
* Adds acronymn tags to the first occuring word which is in the Acronym List | |
* Very nice package which allows your users to see what the abbreviated word is. | |
* | |
* @name | |
* DefinitionList | |
* @version |
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
javascript:(function(){ | |
var overlay = document.getElementById('mw-sopaOverlay'); | |
overlay.parentNode.removeChild(overlay); | |
var pages = ['mw-page-base', 'mw-head-base', 'content', 'mw-head', 'mw-panel', 'footer']; | |
var i = 0; | |
for (i = 0; i < pages.length; i++) { | |
var pageName = pages[i]; | |
var page = document.getElementById(pageName); | |
page.setAttribute('style', ''); | |
page.style.display = 'block'; |
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
{ | |
"name": "Selected Text", | |
"version": "0.1", | |
"description": "Selected Text", | |
"browser_action": { | |
"default_title": "Selected Text", | |
"default_icon": "icon.png", | |
"default_popup": "popup.html" | |
}, | |
"permissions": [ |