Skip to content

Instantly share code, notes, and snippets.

View kaero's full-sized avatar
🐢
slow developer

Philipp Kovalev kaero

🐢
slow developer
View GitHub Profile
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="group">
<!--Start recursion over group children-->
<xsl:apply-templates select="*[1]" mode="group"/>
</xsl:template>
@kaero
kaero / resources.xsd
Created May 26, 2011 09:36
resources.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://example.com/app/resources" xmlns="http://example.com/app/resources"
xmlns:res="http://example.com/app/resources">
<xs:complexType name="resource-description">
<xs:attribute name="src"/>
<xs:attribute name="media"/>
</xs:complexType>
@kaero
kaero / xslt20-with-resources.xsd
Created May 26, 2011 09:37
xslt20-with-resources.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:res="http://example.com/app/resources"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/XSL/Transform"
targetNamespace="http://www.w3.org/1999/XSL/Transform">
<xs:import namespace="http://example.com/app/resources" schemaLocation="resources.xsd"/>
<xs:redefine schemaLocation="http://www.w3.org/2007/schema-for-xslt20.xsd">
<!--
((_)->((_)->(->_--)(_--))(_))(0)
@kaero
kaero / uri.js
Created September 6, 2012 20:43 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();
namespace elmo {
using namespace node;
using namespace v8;
static Handle<Value> get_loop_state(const Arguments& args) {
HandleScope scope;
Local<Array> handles = Array::New();
var net = require('net'),
Memcached = require('memcached'),
mock = net.createServer(function(sock) {
setTimeout(function() {
sock.destroy();
}, 30000);
}),
memcached = new Memcached(['127.0.0.1:11219'], {
var fs = require('fs'),
util = require('util'),
xamel = require('./'),
Tag = require('./lib/xml').Tag;
/**
* @param {NodeSet} nset
* @returns {Object} plain object
*/
function serializeNodeSet(nset) {
$ make openmw-wizard
Scanning dependencies of target components
[ 0%] Building CXX object components/CMakeFiles/components.dir/process/processinvoker.cpp.o
openmw_pvdk/components/process/processinvoker.cpp:65:14: error: use of undeclared identifier 'QCoreApplication'; did you mean 'QApplication'?
QDir dir(QCoreApplication::applicationDirPath());
^~~~~~~~~~~~~~~~
QApplication
/Library/Frameworks/QtGui.framework/Headers/qwindowdefs.h:87:7: note: 'QApplication' declared here
class QApplication;
^