Skip to content

Instantly share code, notes, and snippets.

View omichelsen's full-sized avatar

Ole Bjørn Michelsen omichelsen

View GitHub Profile
@GregPK
GregPK / Regex-Crossword-helper.js
Last active December 20, 2015 06:49
A helper for http://regexcrossword.com. It helps identify which patterns are not met in a non-boolean fashion. It's a spoiler, so use sparringly. Also, please note that not all situations are accounted for (empty spaces, greedy vs non-greedy matching).
window.CrossCrutch = {}
window.CrossCrutch.check = function() {
var messages = [];
$(".puzzle table tbody tr").each(function (i,e) {
var $row = $(e);
var $cols = $row.find("th,td");
var $rowHeader = $cols.filter("th");
var $other = $cols.filter("td");
@spion
spion / screenshot.js
Last active May 27, 2022 01:38
Take website screenshots of any resolution using phantomjs
// Usage: phantomjs screenshot.js 1920x1080 site.domain.com
// outputs to site.domain.com-1920x1080.png
// dont add http to the URL
// If the page didnt render in time add a delay argument
// e.g. 3000 for 3 seconds
var page = require('webpage').create();
var args = require('system').args;
var wh = args[1].split('x');