Skip to content

Instantly share code, notes, and snippets.

View UnquietCode's full-sized avatar

Benjamin Fagin UnquietCode

View GitHub Profile
@UnquietCode
UnquietCode / gist:3711511
Created September 13, 2012 02:46
Extract tweet info from the basic Twitter timeline widget.
<html>
<head>
<script type="text/javascript" src="jquery-1.8.1.min.js"></script>
<script type="text/javascript">
<!-- use the url that your twitter widget is using to retrieve the tweet data -->
$(function() {
$.getJSON("http://cdn.syndication.twimg.com/widgets/timelines/246079887021051904?dnt=true&domain=unquietcode.com&lang=en&callback=?", function(data) {
var tweets = $(data.body).find('li.tweet');
@UnquietCode
UnquietCode / CRUDMap.java
Created September 6, 2012 11:12
Map with simplified CRUD semantics for Java
/**
* Copyright 2012 Benjamin Fagin
* http://www.unquietcode.com
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
@UnquietCode
UnquietCode / NestedClassesExample.java
Created August 24, 2012 15:55
Simulating multiple inheritance in Java.
public class NestedClassesExample {
public static void main(String args[]) {
Child child = new Child();
child.print();
}
public static class ParentA {
public void printA() {
@UnquietCode
UnquietCode / SimpleStateTraverser.java
Created August 9, 2012 04:10
A simple traverser which handles recursive computations, specifically those where it is required to be aware of the previous, current, and next states.
/*******************************************************************************
Copyright 2012 Benjamin Fagin
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