Skip to content

Instantly share code, notes, and snippets.

View tobinharris's full-sized avatar

Tobin Harris tobinharris

View GitHub Profile

yUML Test On GitHub

yUML is a simple tool for embedding UML diagrams in wikis and blogs without needing any UML or diagramming tools.

Here's an idea of how it could be used in your repository readme.markdown or wiki.

View the RAW source to see how images are made.

Example

# Simple Git Analyzer
#
# WORK IN PROGRESS :)
#
# Tobin Harris (tobin@tobinharris.com)
# http://tobinharris.com
# http://engineroomapps.com
# Class to analyze git log
require 'rubygems'
<table cellpadding="0" cellspacing="0" border="0" style="background: none; border-width: 0px; border: 0px; margin: 0; padding: 0;">
<tr>
<td style="vertical-align: top; width: 70px;" valign="top" width="70" >
<a href="https://pocketworks.co.uk" style="border-width:0px; border:0px; text-decoration: none;"><img width="50" height="50" style="border: none; width: 50px; max-width: 50px !important; height: 50px; max-height: 50px !important;" src="https://pocketworks.co.uk/wp-content/uploads/2018/06/pw_logo_primary_100.png"></a>&nbsp;&nbsp;
</td>
<td>
<table cellpadding="0" cellspacing="0" border="0" style="background: none; border-width: 0px; border: 0px; margin: 0; padding: 0;">
<tr><td colspan="2" style="padding-bottom: 5px; color: #444444; font-size: 14px; font-family: Arial, Helvetica, sans-serif;">Tobin Harris</td></tr>
<tr><td colspan="2" style="color: #333333; font-size: 14px; font-family: Arial, Helvetica, sans-serif;">CEO</td></tr>
<tr><td colspan="2" style="color: #333333; font-size: 14px; font-family:
# /etc/init/clockwork.conf - DigitalOcean Rails Image - Clockwork config
# This example config should work with Ubuntu 14.04+. It
# allows you to manage clockwork with
# Upstart, Ubuntu's native service management tool.
#
# Assumes you have a clock.rb script in your Rails app root
#
# Use the service command:
# sudo service clockwork {start,stop,restart,status}
class Device
attr_accessor :mac
attr_accessor :ip
attr_accessor :name
attr_accessor :is_online
attr_accessor :last_seen_at
attr_accessor :last_status_change_at
attr_accessor :status_changed
def initialize(options={})
@charset "utf-8";
html {
width: 100%;
height: 100%;
}
* {
margin: 0;
padding: 0;
}
*:focus {
#/bin/bash
osascript '-e tell app "Skype" to send command "SET USERSTATUS ONLINE" script name "Tobins Skype Control"'
#/bin/bash
osascript '-e tell app "Skype" to send command "SET USERSTATUS DND" script name "Tobins Skype Control"'
#
# Simple way of grabbing tweets for Rails
# http://tobin@tobinharris.com
# Example on the home page of http://yuml.me
#
require 'rexml/document'
require 'open-uri'
include REXML
class TwitterController < ApplicationController
# Find all tweets containing the term Basecamp that were posted to @37signals
# You don't have to pipe to xpath, I just find it easier for understanding the results :)
curl http://search.twitter.com/search.atom?q=basecamp+to:37signals | xpath '//title/text()'
# Find all tweets containing the term Basecamp that were NOT posted to @37signals
curl http://search.twitter.com/search.atom?q=basecamp+-to:37signals | xpath '//title/text()'
require 'rubygems'
require 'hpricot'
require 'open-uri'
require 'pp'
class Spider
def initialize
@max_pages = 50
@counter = 0