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 num = Math.floor((Math.random()*999999999)+100000000); | |
console.log("random number: " + num); | |
var str = num.toString(); | |
var num_array = str.split(""); | |
console.log("number array: " + num_array); | |
function interesting_rule(num_array) { | |
var sum_even = parseInt(num_array[1]) + parseInt(num_array[3]) + parseInt(num_array[5]) +parseInt(num_array[7]); | |
var sum_odd = parseInt(num_array[0]) + parseInt(num_array[2]) + parseInt(num_array[4]) +parseInt(num_array[6]) + parseInt(num_array[8]); | |
return ((sum_odd*7)-sum_odd)%10; |
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
/*********************** Fontdetect - The font stuff - START ********************/ | |
var font = document.getElementById('font'); // The hidden input field | |
var output = document.getElementById('output'); // the detected font results go here | |
var fontList =''; // the result | |
var computed = window.getComputedStyle(output, null); // the actual style of the tested element | |
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
window.addEventListener('DOMContentLoaded', function() { | |
if (opera.contexts.menu) { // Check the Context Menu API is supported | |
var menu = opera.contexts.menu; // Create a menu item properties object | |
var itemProps = { | |
contexts: ['page', 'link'], | |
icon: 'images/chrome.png', | |
documentURLPatterns: [ | |
'http://chrome.google.com/webstore/*', | |
'https://chrome.google.com/webstore/*' |