This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cgi' | |
source = ARGV.shift | |
exit if ! source | |
def header(name) | |
h = '<pre class="code"><code>' + "(#{File.basename(name)})" | |
puts h | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: stylerepo | |
version: 1 | |
runtime: python | |
api_version: 1 | |
handlers: | |
- url: /stylesheets | |
static_dir: stylesheets | |
- url: .* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html dir='ltr' xmlns='http://www.w3.org/1999/xhtml'> | |
<head> | |
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/> | |
<title>Check style priorities with CSS Contextual Selectors</title> | |
<link type='text/css' rel='stylesheet' href='priority.css' /> | |
<style type="text/css"> | |
h1#header1 { color: orange; } | |
h1 { color: red; } | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: stylerepo | |
version: 1 | |
runtime: python | |
api_version: 1 | |
handlers: | |
- url: /stylesheets | |
static_dir: stylesheets | |
- url: /logrepo/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/local/bin/ruby1.9 -w | |
# -*- coding: utf-8 -*- | |
# get_titles.rb: get post tiltes from Blogger RSS feed. | |
require 'net/http' | |
require 'uri' | |
require 'rss' | |
BLOGID = "put your blog ID here" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /opt/local/bin/ruby1.9 -w | |
# -*- coding: utf-8 -*- | |
# get_tag_and_class.rb: extract tag and class names from a HTML document. | |
regex = Regexp.compile('<(\w+)[^<>]*class=[\'\"]([^\'\"]+)[\'\"][^<>]*>') | |
result = Array.new | |
Tuple = Struct.new(:line_number, :tag, :class) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# get_tag_and_class.rb: extract tag and class names from a HTML document. | |
import sys | |
import re | |
regex = re.compile('<(\w+)[^<>]*class=[\'\"]([^\'\"]+)[\'\"][^<>]*>') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/local/bin/gosh | |
;; -*- coding: utf-8 -*- | |
;; get_tag_and_class.scm: extract tag and class names from a HTML document. | |
(define (match-tag-and-class line) | |
(rxmatch-case line | |
[#/<(\w+)[^<>]*class=[\'\"]([^\'\"]+)[\'\"][^<>]*>(.*)/ | |
(all tag class rest) | |
(if (> (string-length rest) 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/local/bin/gosh | |
;; -*- coding: utf-8 -*- | |
;; wordcount.scm: a simple filter to count lines/words/characters. | |
(define (apply-filter proc port) | |
(let ((line (read-line port))) | |
(if (not (eof-object? line)) | |
[begin | |
(proc line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
from google.appengine.api import users | |
from google.appengine.ext import webapp | |
from google.appengine.ext.webapp import util | |
from google.appengine.ext import db | |
import datetime | |
import logging |
OlderNewer