Skip to content

Instantly share code, notes, and snippets.

View willbailey's full-sized avatar

Will Bailey willbailey

  • Facebook
  • San Francisco, CA
View GitHub Profile
require 'net'
require 'net'
@willbailey
willbailey / gist:32344
Created December 5, 2008 14:31
audit the privacy settings on documents uploaded to the scribd api
# This script will verify the privacy settings on documents you have loaded
# to the scribd api.
require 'rubygems'
require 'hpricot'
require 'open-uri'
def get_docs(api_uri, limit, offset)
api_uri += "&limit=#{limit}&offset=#{offset}"
(function(){
Zen.UI.Mixins.Bindable = {
// bind the model to the view
setModel : function(model){
this.model = model;
this.model.observe(Observable.ALL_EVENTS, this._onModelEvent.bind(this), this, 'Zen.UI.View observer');
},
// handle binding to the model
View Constructor:
this.configure(options);
this._reset();
this.render();
Base View
.el - conventional root element reference for every view
.toElement - returns this.el
.childViews - Array of child views
/**
* Move the root element offscreen
* @function ?
*/
hideOffscreen : function(){
this.el.setStyle({position:'absolute', top:'-5000px', left:'-5000px'})
},
/**
* Center the root element on the target
(function(){
Channels.UI.TimezonePulldown = Class.create(ZenUIView);
Channels.UI.TimezonePulldown.addMethods({
initialize : function($super, options){
this.klassName = 'Channels.UI.TimezonePulldown';
this.defaultTimezone = 'America/New_York';
this.callbacks = {
normal : [
#! /usr/bin/env ruby
require 'rubygems'
require 'hpricot'
username = "<username>"
password = "<password>"
tix = Hpricot(IO.popen("curl https://trac.zenbe.com/report/7 --basic -u #{username}:#{password} -k -s"))
(tix/"table.listing.tickets"/"tbody"/"tr").each { |row|
ticket = (row/"td.ticket"/"a").first.inner_html
@willbailey
willbailey / tix
Created June 1, 2009 15:03 — forked from jashkenas/tix
#! /usr/bin/env ruby
require 'rubygems'
require 'hpricot'
require 'time'
username = "<username>"
password = "<password>"
tix = Hpricot(IO.popen("curl https://trac.zenbe.com/report/7 --basic -u #{username}:#{password} -k -s"))