Skip to content

Instantly share code, notes, and snippets.

@dustingetz
dustingetz / gist:868368
Created March 13, 2011 19:50
wave robot api, add participant trace
2011-03-13 12:44:11.076 /_wave/robot/jsonrpc 200 215ms 270cpu_ms 196api_cpu_ms 0kb WaveRobotGateway
10.12.168.13 - - [13/Mar/2011:12:44:11 -0700] "POST /_wave/robot/jsonrpc HTTP/1.1" 200 639 - "WaveRobotGateway" "dustin-getz.appspot.com" ms=215 cpu_ms=270 api_cpu_ms=197 cpm_usd=0.008149
I 2011-03-13 12:44:10.881
server_rpc_base: None
I 2011-03-13 12:44:10.881
server:https://www-opensocial.googleusercontent.com/api/rpc
I 2011-03-13 12:44:10.882
Incoming: {"events":[{"type":"WAVELET_SELF_ADDED","modifiedBy":"dustin.getz@googlewave.com","timestamp":1300045450639,"properties":{"blipId":"b+c5hJ3nfVB"}}],"wavelet":{"creationTime":1300042639323,"lastModifiedTime":1300045450639,"version":2722,"participants":["dustin.getz@googlewave.com","dustin-getz@appspot.com"],"participantRoles":{"dustin-getz@appspot.com":"FULL","dustin.getz@googlewave.com":"FULL"},"dataDocuments":{},"tags":[],"creator":"dustin.getz@googlewave.com","rootBlipId":"b+c5hJ3nfVB","title":"code `null\u003d\u003dfoo` vs `foo\u003d\u003dnull`","waveId":"g
@dustingetz
dustingetz / rendered-wave.html
Created March 13, 2011 19:51
wave robot api add participant trace
{
"events": [
{
"type": "WAVELET_SELF_ADDED",
"modifiedBy": "dustin.getz@googlewave.com",
"timestamp": 1300045450639,
"properties": {
"blipId": "b+c5hJ3nfVB"
}
}
{
"comments": [
{
"postedBy": "dustingetz",
"postedAgo": "2 days ago",
"comment": "\u003cfont \u003eits likely fake. homepage.mac.com was for public content, kinda like geocities.\u003c/font\u003e",
"id": 2319765,
"points": 2,
"parentId": 2318910,
"postId": 2318910,
"data": {
"root": [
{
"master_item_id": "Master ITEM ID 1", //repeating, should be list
"a_created_date": "2011-03-09 13:48:30.823",
"a_modified_by": "junit",
"i_revision": 0,
"i_id": "000300000000000000002BC7",
"a_modified_date": "2011-03-09 13:48:30.823",
"item_association_code": null, //repeating, should be empty list
String sql_fmt = "INSERT INTO %s.%s (%s) VALUES (%s)";
String schema = context.getSchema();
String table = typeInfo.getRepeatingTableName();
CollectionUtil.transform_i(attrs, toSqlValues);
String col_sql = StringUtils.join(attrs.keySet().toArray(), ",");
String value_sql = StringUtils.join(attrs.values().toArray(), ","); //TreeSet key order maintained
String sql = String.format(sql_fmt, schema, table, col_sql, value_sql);
@dustingetz
dustingetz / gist:877957
Created March 20, 2011 00:50
stateful html generator evil!
public WriterBackedGenerator write(String text)
{
text = ((text == null) ? "" : text);
if (_scripting || _noEscape) // *djg* horrors!!
{
writeToBuffer(text);
}
else if (text.equals(" "))
{
@dustingetz
dustingetz / link-bookmarklet.js
Created March 20, 2011 16:13
buzz note bookmarklet
javascript:
var b=document.body;
var GR________bookmarklet_domain='http://www.google.com';
if(b && !document.xmlVersion) {
void(z=document.createElement('script'));
void(z.src='http://www.google.com/reader/ui/link-bookmarklet.js');
void(b.appendChild(z));
}
else{}
@dustingetz
dustingetz / gist:878573
Created March 20, 2011 19:18
blip indentation
"elements": {
"55": {
"type": "LINE",
"properties": {
"indent": "1"
}
}
}
@dustingetz
dustingetz / gist:889465
Created March 27, 2011 18:51
facebook badge embed
<div id="facebook-embed">
<!-- Facebook Badge START --><a href="http://www.facebook.com/dustin.getz" target="_TOP" style="font-family: &quot;lucida grande&quot;,tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;" title="Dustin Getz">Dustin Getz</a><br/><a href="http://www.facebook.com/dustin.getz" target="_TOP" title="Dustin Getz"><img src="http://badge.facebook.com/badge/6103645.1191.1673872666.png" width="120" height="335" style="border: 0px;" /></a><br/><a href="http://www.facebook.com/badges/" target="_TOP" style="font-family: &quot;lucida grande&quot;,tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;" title="Make your own badge!">Create Your Badge</a><!-- Facebook Badge END -->
</div><!-- end facebook-embed -->
var oPosts = $('table td .title a');
oPosts.each(function(index, oPost){
var sTitle = oPost.innerHTML;
var oScoreRow = $(oPost).parent().parent().next();
var sVotes = oScoreRow.find('span')[0].innerHTML;
var sComments = oScoreRow.find('a')[1].innerHTML;