Skip to content

Instantly share code, notes, and snippets.

@atifaziz
atifaziz / iecache.cpp
Created August 13, 2008 08:55
iecache
//
// Copyright (c) 2005 Atif Aziz. All rights reserved.
//
// Author(s):
//
// Atif Aziz, http://www.raboof.com
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the New BSD License, a copy of which should have
// been delivered along with this distribution.
{
"logon": "john@fakesite.com",
"addresses": [
{
"shippingAddressCount":"2",
"shipping": [
{
"firstName": "John",
"lastName": "Smith",
"address1": "111 Fake St.",
@atifaziz
atifaziz / gist:5275
Created August 13, 2008 17:43
JsonRpcProxyGenerator.Generate demo
import clr
clr.AddReferenceToFileAndPath(r'C:\Jayrock\bin\Release\Jayrock.dll')
from Jayrock.JsonRpc import *
from Jayrock.JsonRpc.Web import *
from System import Uri, Console
class MyService(JsonRpcService):
pass
@atifaziz
atifaziz / jsproxy.py
Created August 13, 2008 18:43
Jayrock JS proxy tool
#
# Usage: jsproxy ASSEMBLY-PATH TYPENAME ( URL )
#
import sys
import clr
clr.AddReferenceToFileAndPath(r'C:\Jayrock\bin\Release\Jayrock.dll')
from sys import stderr
from Jayrock.JsonRpc import *
@atifaziz
atifaziz / net35sp1.diff
Created August 13, 2008 22:13
diff NET 3.5 > SP1
--- net35.txt 2008-08-13 23:49:30.514820700 +0200
+++ net35sp1.txt 2008-08-13 23:50:14.993091100 +0200
@@ -5,15 +5,27 @@
Microsoft.VisualC.STLCLR.dll
System.AddIn.Contract.dll
System.AddIn.dll
+System.ComponentModel.DataAnnotations.dll
System.Core.dll
System.Data.DataSetExtensions.dll
+System.Data.Entity.Design.dll
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Jayrock + JQuery</title>
<script type="text/javascript" language="javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js"></script>
<script type="text/javascript" language="javascript" src="http://www.raboof.com/projects/jayrock/demo.ashx?proxy"></script>
<script type="text/javascript" language="javascript">
var channels = {
'jquery.get': new JQueryChannel({ cache: true }),
'jquery.get-nocache': new JQueryChannel({ cache: false }),
import sys, urllib2, httplib, os
# Adapted from "Archiving Twitter data with Python" at:
# http://morethanseven.net/posts/archiving-twitter-data-with-python/
#
# See also "Download entire twitter archive of a user" at:
# http://groups.google.com/group/twitter-development-talk/t/91f8ac9437f1ba72
class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
/*
Demonstrates how to sanitize and extract values from the AllXml column
as additional columns for data mining and reporting purposes.
See also "Additional Reporting" discussion thread at:
http://groups.google.com/group/elmah/t/28d8fce91a407494
*/
SELECT
[ErrorId],
@atifaziz
atifaziz / enpy.py
Created September 4, 2008 11:27
Extracts Python script from an interactive session source
import sys, re
def main(args):
input = sys.stdin.read()
# Mac and Windows line endings to *nix
lines = input.replace('\r\n', '\r').replace('\r', '\n').split('\n')
exp = re.compile(r'(?:(?:\>|\.){3})\s(.+)')
print '\n'.join(
[match.group(1) for match in [
exp.search(line) for line in lines] if match])
Imports System
Imports System.Collections
Imports System.Web.Services.Protocols
Imports System.Net
Imports System.IO
Imports System.Text
Imports Microsoft.VisualBasic
Imports Jayrock.Json
Module MainModule