Skip to content

Instantly share code, notes, and snippets.

View timfeirg's full-sized avatar
🌴
On vacation

timfeirg timfeirg

🌴
On vacation
View GitHub Profile
document.querySelectorAll(".diff-table").forEach(table => {
table.onmouseover = evt => {
if (evt.target.tagName !== "TD") {
return;
}
const cellIndex = evt.target.cellIndex;
table
.querySelectorAll(`tr td.blob-code:nth-child(${cellIndex === 1 ? 2 : 4})`)
.forEach(el => {
el.style["userSelect"] = "auto";
@saidimu
saidimu / gist:1024207
Created June 14, 2011 02:36
Generating URLs to crawl from outside a Scrapy spider
from scrapy import log
from scrapy.item import Item
from scrapy.http import Request
from scrapy.contrib.spiders import XMLFeedSpider
def NextURL():
"""
Generate a list of URLs to crawl. You can query a database or come up with some other means
Note that if you generate URLs to crawl from a scraped URL then you're better of using a