Skip to content

Instantly share code, notes, and snippets.

View tonycosentini's full-sized avatar
🍕

Tony Cosentini tonycosentini

🍕
View GitHub Profile
POST /xmlrpc.php HTTP/1.1
Host: starnix17.wordpress.com
Accept: */*
Content-Length: 0
Content-Type: application/x-www-form-urlencoded
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 27 Mar 2010 17:06:57 GMT
Content-Type: text/plain;charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<project name="test" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked in in Version
Control Systems. -->
<property file="local.properties" />
<!-- The build.properties file can be created by you and is never touched
by the 'android' tool. This is the place to change some of the default property values
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_SUBJECT, "Set Subject Here");
i.putExtra(Intent.EXTRA_TEXT, "Contents Goes Here");
startActivity(Intent.createChooser(i, "Title For Menu"));
@tonycosentini
tonycosentini / test_tumblr.rb
Created May 2, 2011 15:28
Tumblr to Jekyll Tests
require 'rubygems'
gem 'RedCloth', '>= 4.2.1'
require 'RedCloth'
require 'rdiscount'
require 'kramdown'
require 'test/unit'
require 'redgreen'
require 'shoulda'
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="http://localhost:3000/socket.io/socket.io.js"></script>
<script src="./jquery-1.6.2.min.js"></script>
<script type="text/javascript">
var socket = io.connect('http://localhost:3000/');
var handle = "";
@tonycosentini
tonycosentini / Enter.js
Created October 24, 2011 23:43
Empty Last.fm Page
$('#search').keypress(function(e) {
if(e.which == 13) {
$("#form").fadeOut(function() {
$("#loading").fadeIn();
});
// The rest of the code will go here.
}
});
public class RssItem {
public String title;
public String body;
public String permalinkURL;
public String author;
public Date publishedTime;
}
public RssParser(String feedURLString) throws Exception {
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet(feedURLString);
HttpResponse response = client.execute(request);
SAXParserFactory f = SAXParserFactory.newInstance();
SAXParser parser = f.newSAXParser();
XMLReader reader = parser.getXMLReader();
RssHandler handler = new RssHandler();
reader.setContentHandler(handler);
public class RssHandler extends DefaultHandler {
private Stack<String> mTagStack = new Stack<String>();
private String currentTagContents;
private String currentTag() { return mTagStack.peek(); }
private String parentTag() { return mTagStack.get(mTagStack.size() - 2); }
public ArrayList<RssItem> mItems = new ArrayList<RssItem>();
private RssItem mCurrentItem;
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>