Skip to content

Instantly share code, notes, and snippets.

View kir's full-sized avatar

Kirill Maximov kir

  • JetBrains, s.r.o.; Checkvist, s.r.o.
  • Prague
View GitHub Profile
@kir
kir / opml2csv.xsl
Last active September 26, 2015 09:37
XSL-based converter from OPML to CSV (created for Checkvist outliner), see http://checkvist.tumblr.com/post/7578054148
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/> <!-- We're generating text, not xml -->
<xsl:strip-space elements="*"/> <!-- Remove all spaces not inserted specifically by us -->
<!-- Separator for CSV file: if you use tags AND set this to ',' the tags will end up in separate columns -->
<xsl:variable name="separator" select="';'"/>
<xsl:template match="head"/>
@kir
kir / assert_no_database.rb
Created October 22, 2011 09:22
assert_no_database test helper (Rails 3)
module AssertNoDatabase
def assert_no_database
@query_count = 0
@query_sql = []
_subscribe_to_sql
yield
assert_equal 0, @query_count, "Unexpected SQL queries:\n " << @query_sql.join("\n ")
end
@kir
kir / qunit.teamcity.js
Last active December 23, 2015 13:19
QUnit integration with TeamCity (via service messages)Supports stacktraces, comparison failure diffs for large texts.
(function(QUnit) {
var tcEscape = function(str) {
str = str ? str.toString() : "";
str = str.replace(/\n/g, "|n");
str = str.replace(/\r/g, "|r");
str = str.replace(/(['\[\]])/g, "|$1");
return str;
};
@kir
kir / bookmarklet.js
Created July 28, 2014 20:18
Checkvist bookmarklet
maxkir_screen = function() {
var x,y;
if (self.innerHeight) {// all except Explorer
x = self.innerWidth;
y = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight) {
// Explorer 6 Strict Mode
x = document.documentElement.clientWidth;
y = document.documentElement.clientHeight;
@kir
kir / qunit-puppeteer-runner.js
Last active March 17, 2018 13:53
qunit-puppeteer-runner (was created as a replacement for qunit-phantomJs runner)
#! /usr/bin/env node
// Based on https://github.com/davidtaylorhq/qunit-puppeteer package by David Taylor
// But compatible with NodeJS 6.x
// Usage:
// node puppeteer_qunit_runner.js [url-of-your-qunit-testsuite] [timeout-in-seconds]
//
const puppeteer = require('puppeteer');