Skip to content

Instantly share code, notes, and snippets.

<div data-forkme="https://github.com/amobiz/lazy-umd.js"></div>
@inno-v
inno-v / github.ribbon
Created September 21, 2014 16:23
Add GitHub Ribbon on Blogger
<script>
//<![CDATA[
/* Add GitHub Ribbons */
(function(options) {
var el, href, pos;
if (location.pathname==='/') {
href = options.home;
}
else {
/*
Copyright (C) 2021 Pascal de Vink (Tweakers.net)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
<style>
.hentry .gist .gist-file {
margin-bottom: 0;
border: none;
}
.gist, pre.code {
display: block;
overflow: auto;
min-height: 30px;
max-height:800px;
function() {
}
@echo off & goto CONFIG
:SYNTAX
echo Syntax: %~n0 [DIFF|FULL] [folders]
goto END
:CONFIG
set BAK_DIR=[你要儲存備份檔的目錄,不要包含路徑最後的 \ 字元]
import java.io.FileWriter
import org.jdom.*
import org.jdom.input.*
import org.jdom.xpath.*
import org.jdom.output.*
import org.xml.sax.*
def builder = new SAXBuilder( "org.ccil.cowan.tagsoup.Parser" )
builder.setFeature( "http://xml.org/sax/features/namespace-prefixes", true )
builder.setFeature( "http://xml.org/sax/features/namespaces", false )
public void parse (InputSource input) throws IOException, SAXException {
setup();
Reader r = getReader(input);
theContentHandler.startDocument();
theScanner.resetDocumentLocator(input.getPublicId(), input.getSystemId());
if (theScanner instanceof Locator) {
theContentHandler.setDocumentLocator((Locator)theScanner);
}
// hack start
if (namespaces)
import java.io.*
import org.jdom.*
import org.jdom.input.*
import org.jdom.xpath.*
import org.jdom.output.*
import org.xml.sax.*
def xhtml = """<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:myns="http://www.w3.org/1999/xhtml"