Skip to content

Instantly share code, notes, and snippets.

View martin12333's full-sized avatar

Martin Milan martin12333

View GitHub Profile
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="en-note">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="div">
<p>
<xsl:apply-templates/>
</p>
@snb
snb / virtualbox_ports.png
Created January 24, 2010 01:46
virtualbox serial console
virtualbox_ports.png
@erikvold
erikvold / jQueryForChromeExample.user.js
Created June 14, 2010 10:06
This userscript is meant to be an example on how to use jQuery in a userscript on Google Chrome.
// ==UserScript==
// @name jQuery For Chrome (A Cross Browser Example)
// @namespace jQueryForChromeExample
// @include *
// @author Erik Vergobbi Vold
// @description This userscript is meant to be an example on how to use jQuery in a userscript on Google Chrome.
// ==/UserScript==
// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
@pablox-cl
pablox-cl / html2text.sh
Created November 9, 2010 00:59
Bash script to convert all the html files in a directory to text files
#!/usr/bin/env bash
# (C) 2010 - Pablo Olmos de Aguilera Corradini <pablo{at)glatelier.org>
# Under GPL v3. See http://www.gnu.org/licenses/gpl-3.0.html
# requires html2text.py
wget -q http://www.aaronsw.com/2002/html2text/html2text.py
for file in *.html; do
name=$(basename $file)
name=${file%.*}
@rocketnia
rocketnia / lava.html
Created February 23, 2011 17:51
Try LavaScript
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Try LavaScript</title>
<!--
Copyright 2011 Ross Angle (rocketnia). This file is released under
the Perl Foundation's Artistic License 2.0.
Not covered by the license are Underscore, jQuery, jQuery-console,
@tlrobinson
tlrobinson / LICENSE.txt
Created October 4, 2011 14:04 — forked from 140bytes/LICENSE.txt
Simple JavaScript REPL for the browser.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Tom Robinson <http://tlrobinson.net/>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@ernestom
ernestom / word-frequency-counter.js
Created February 13, 2012 18:38
Bookmarklet to count word frequency
(function () {
function getBodyText(win) {
var doc = win.document,
body = doc.body,
selection, range, bodyText;
if (body.createTextRange) {
return body.createTextRange().text;
} else if (win.getSelection) {
selection = win.getSelection();
range = doc.createRange();
@TooTallNate
TooTallNate / bbs.js
Created March 16, 2012 22:42
Running a node.js REPL over `curl`
/**
* Requires node v0.7.7 or greater.
*
* To connect: $ curl -sSNT. localhost:8000
*/
var http = require('http')
, repl = require('repl')
, buf0 = new Buffer([0])
@TooTallNate
TooTallNate / repl-client.js
Created March 26, 2012 20:09
Running a "full-featured" REPL using a net.Server and net.Socket
var net = require('net')
var sock = net.connect(1337)
process.stdin.pipe(sock)
sock.pipe(process.stdout)
sock.on('connect', function () {
process.stdin.resume();
process.stdin.setRawMode(true)
@jberryman
jberryman / canvas2png.js
Created April 30, 2012 19:19
A jQuery one-liner for converting all html5 canvas elements in the DOM to PNGs
$('canvas').each(function(i,e){ var img = e.toDataURL("image/png"); $(e).replaceWith( $('<img src="'+img+'"/>').attr({width: $(e).attr("width"), height: $(e).attr("height"), style: $(e).attr("style") }) ) });