Skip to content

Instantly share code, notes, and snippets.

@adewale
adewale / gist:435aa835cfa0f06004b5
Created August 7, 2015 00:28
JSON requires 1 top level object but it doesn't seem to be mentioned in the spec
Valid
[1]
Invalid
[1],[2]
Valid
[[1], [2]]
list := List clone
while (list count() < 6,
n := Number random(1, 50) floor
if( (list contains( n ) ) == Nil, //true if list doesn't contain n
list add( n )
)
)
Became:
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:activity="http://activity
strea.ms/spec/1.0/" xmlns:georss="http://www.georss.org/georss">
<link rel="self" type="application/atom+xml" href="http://buzz.googleapis.com/feeds/105037104815911535953/public/posted"/>
<link rel="hub" href="http://pubsubhubbub.appspot.com/"/>
<link rel="next" href="http://buzz.googleapis.com/feeds/105037104815911535953/public/posted?c=CKKwyfHgoaEC"/>
<title type="text">Google Buzz</title>
<updated>2010-05-02T22:03:36.845Z</updated>
<id>tag:google.com,2009:buzz-feed/public/posted/105037104815911535953</id>
<generator>Google - Google Buzz</generator>
<entry><title type='html'>Buzz by Adewale Oshineye from Flickr</title><summary type='text'>Dignity</summary><published>2010-05-15T18:54:47.000Z</published><updated>2010-05-15T18:56:28.646Z</updated><id>tag:google.com,2009:buzz/z12kszih2ki3izjad04cjldqhk2ffnwpzys0k</id><link rel='alternate' type='text/html' href='http://www.google.com/buzz/105037104815911535953/ahZmesjj576/Dignity'/><author><name>Adewale Oshineye</name><uri>http://www.google.com/profiles/adewale</uri></author><content type='html'>&lt;div&gt;Dignity&lt;/div&gt;</content><link rel='enclosure' href='http://www.flickr.com/photos/38234898@N00/4609072165' type='image/jpeg' title='Dignity'/><media:content url='http://www.flickr.com/photos/38234898@N00/4609072165' type='image/jpeg' medium='image'><media:title>Dignity</media:title><media:player url='http://farm2.static.flickr.com/1431/4609072165_bdc218096f_o.jpg' height='4256' width='2832'/></media:content><activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb><activity:object><activity:
#Simple searching in Buzz using the Python client
import buzz
b = buzz.Client()
r = b.search('hello')
print r.data[1].content
@adewale
adewale / buzz-dlf-example.py
Created January 29, 2011 12:52
Example to verify that data can be liberated from Buzz
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@adewale
adewale / gist:891390
Created March 28, 2011 22:03
Why I changed my mind about UX and software design
Getting real: http://www.amazon.com/Getting-Real-smarter-successful-application/dp/0578012812/
Rework: http://www.amazon.com/Rework-Jason-Fried/dp/0307463745
Growing object oriented code guided by tests: http://www.amazon.com/Growing-Object-Oriented-Software-Guided-Tests/dp/0321503627
Living with complexity: http://www.amazon.com/Living-Complexity-Donald-Norman/dp/0262014866
Background:
http://en.wikipedia.org/wiki/GOMS
http://www.usabilityfirst.com/usability-methods/hci-design-approaches/
http://www.alistapart.com/articles/can-you-say-that-in-english-explaining-ux-research-to-clients/
http://www.thinkoutsidein.com/blog/about/
@adewale
adewale / AndroidManifest.xml
Created September 29, 2015 18:28
Excerpt of example an Android Manifest file
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="applinkingexperiment.appspot.com" android:scheme="http"/>
<data android:host="applinkingexperiment.appspot.com" android:scheme="https"/>
</intent-filter>
var moment = {
'type' : 'http://schemas.google.com/AddActivity',
'target' : {
'url' : 'https://developers.google.com/+/web/snippet/examples/widget'
}
};
var request = gapi.client.request({
'path' : 'plus/v1/people/me/moments/vault',
'method' : 'POST',
@adewale
adewale / gist:6545240
Last active December 22, 2015 23:09
A little survey of the state of the art in embeds across the web
Google+:
<!-- Place this tag in your head or just before your close body tag. -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<!-- Place this tag where you want the widget to render. -->
<div class="g-post" data-href="https://plus.google.com/105037104815911535953/posts/UmRCitJhbGd"></div>
Facebook:
<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-post" data-href="https://www.facebook.com/photo.php?fbid=593929277310086&amp;set=a.229737897062561.56301.193742123995472&amp;type=1" data-width="550"><div class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/photo.php?fbid=593929277310086&amp;set=a.229737897062561.56301.193742123995472&amp;type=1">Post</a> by <a href="https://www.facebook