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
{ | |
let ww = gBrowser.selectedBrowser.boxObject.width; | |
let wu = gBrowser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); | |
let w = parseFloat(wu.getDocumentMetadata("viewport-width")); | |
//gBrowser.contentDocument.documentElement.style.width = w + 'px'; | |
if (!isNaN(w)) | |
ZoomManager.zoom = ww/w; | |
} |
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
var start = Date.now(); | |
var cutoff = (Date.now() - 180 * 86400000) * 1000; | |
var min_frecency = 50; | |
PlacesUtils.history.DBConnection.createAsyncStatement( | |
'UPDATE moz_places SET ' + | |
'visit_count = MAX((SELECT COUNT(*) FROM moz_historyvisits WHERE place_id = moz_places.id AND visit_date > ' + cutoff + '), 1) ' + | |
'WHERE frecency > ' + min_frecency | |
).executeAsync({ | |
handleCompletion: function() { | |
PlacesUtils.history.DBConnection.createAsyncStatement( |
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
Components.utils.import("resource://gre/modules/Services.jsm"); | |
let redirects; | |
let pref = { | |
name: "extensions.something.pref", | |
init: function() { | |
this.readPref(); | |
Services.prefs.addObserver(this.name, this, false); | |
}, |
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
import csv, re | |
from hashlib import sha1 | |
from math import cos, radians, sin, atan, degrees, pi, sqrt, hypot | |
csv.field_size_limit(13107200) | |
paths = dict() | |
with open('tm-world-borders-03.csv', 'r') as csvfile: | |
csvreader = csv.reader(csvfile, delimiter=',', quotechar='"') |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> | |
<_name>My Guides Creator</_name> | |
<id>net.darktrojan.myguidescreator</id> | |
<dependency type="executable" location="extensions">my_guides_creator.py</dependency> | |
<dependency type="executable" location="extensions">inkex.py</dependency> | |
<param name="vertical_guides" type="int" min="1" max="1000" _gui-text="Columns:">2</param> | |
<param name="horizontal_guides" type="int" min="1" max="1000" _gui-text="Rows:">3</param> | |
<param name="guide_margin" type="int" min="0" max="20" _gui-text="Margin around guides (mm)">10</param> | |
<param name="start_from_edges" type="boolean" _gui-text="Start from edges">true</param> |
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 argparse, math | |
parser = argparse.ArgumentParser() | |
parser.add_argument(dest='width', type=int) | |
parser.add_argument(dest='height', type=int) | |
parser.add_argument('-s', dest='spacing', type=int, nargs='?', default=20) | |
parser.add_argument('-b', dest='blackness', type=float, nargs='?', default=0.75) | |
args = parser.parse_args() |
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
var script = 'data:text/plain,' + encodeURIComponent(` | |
var cursors = { | |
pointer: 'red', | |
text: 'blue' | |
}; | |
var lastEvent; | |
var left = 200; | |
var top = 0; | |
var canvas = content.document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas'); | |
canvas.width = 800; |
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
var script = 'data:text/plain,' + encodeURIComponent(` | |
let DOMUtils = Components.classes['@mozilla.org/inspector/dom-utils;1'].getService(Components.interfaces.inIDOMUtils); | |
for (let ss of content.document.styleSheets) { | |
if (content.matchMedia(ss.media.mediaText).matches) { | |
content.console.log(ss); | |
for (let r of ss.cssRules) { | |
rule(r); | |
} | |
} |
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
// for use on https://www.youtube.com/watch?v=e1X4RPDE-48 | |
var video = document.querySelector('video'); | |
var count = 0; | |
var interval = null; | |
video.ontimeupdate = function(event) { | |
if (interval === null && !this.paused && this.currentTime > 175 && this.currentTime < 180) { | |
console.log('start'); | |
count = 0; | |
interval = setInterval(doIt, 40); | |
} |
OlderNewer