Skip to content

Instantly share code, notes, and snippets.

View seanho's full-sized avatar

Sean Ho seanho

View GitHub Profile
<?php
if ($_GET['type'] == 'archive')
{
try
{
$db = new PDO("sqlite:talkonly.sqlite");
$sql = "SELECT * FROM play_items ORDER BY list_id DESC, item_id ASC";
$json_output = array();
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="microsoft.scripting" type="Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting, Version=0.9.6.20, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
</configSections>
<microsoft.scripting>
<languages>
<language names="IronRuby;Ruby;rb" extensions=".rb" displayName="IronRuby 0.9.3"
type="IronRuby.Runtime.RubyContext, IronRuby, Version=0.9.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</languages>
using System;
using System.IO;
using System.Reflection;
using IronRuby;
using Microsoft.Scripting.Hosting;
namespace IronRubyConsole
{
class Program
web = HtmlAgilityPack::HtmlWeb.new
doc = web.Load 'http://hk.news.yahoo.com/hongkong/index.html'
node = doc.DocumentNode.SelectSingleNode '/html/body/div/div[2]/div/div/div/div/div/div/div[2]'
node.ChildNodes.each do |n|
output.WriteLine n.InnerText
end
#output.WriteLine doc.DocumentNode.InnerHtml
<rule name="Rewrite subdomain" stopProcessing="false">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(?!www)(\w+)\.domain\.net$" />
</conditions>
<action type="Rewrite" url="{C:1}/{R:1}" />
</rule>