Skip to content

Instantly share code, notes, and snippets.

@lachlanhardy
lachlanhardy / .gitignore
Created August 5, 2008 12:06
Twitterific Power User settings
privatefilter.bash
def f(ra,n)
r=0
ra.each {|x| r+=1 if x.include? n}
r
end
# So this is in my controller:
@items = Dir.glob("views/*/*")
# Its contents look like this:
# views/controls/actions.haml
# views/controls/buttons.haml
# views/controls/formForge.haml
# views/controls/hide-actions.haml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='en-US' xml:lang='en-US' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>IE float bug</title>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
<style type='text/css'>
body {
font-family: Helvetica, sans-serif; }
#container {
# assume we're passing the values from the file below as arguments to the following:
# WTF is name always nil?
def filtered_filenames(paths)
paths ||= []
paths.collect { |path|
path[/.+\/(.+)$/, 1]
}.reject { |name|
name == "index.haml"
}
# cut out of a real app, so a bit bastardised and probably wouldn't run as it's own Sinatra app, but I think it pretty much covers the entire process of Twitter OAuth
require 'sinatra'
gem 'oauth'
require 'oauth/consumer'
module Twitter
class Application < Sinatra::Application
enable :sessions
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style>
.wrapper { border: 1px solid black; }
.wrapper h3 a { float: right; width: auto; }
</style>
<!--[if lte IE 7]>
<style>
/* This is a small patch to make callbacks work - I'll con Mr Speaker
into getting some proper scm on this sucker soon */
/*
Do 1UP style notification
version 0.1
As inspired by Jeremy Keith post: http://adactio.com/journal/1626/
*/
(function($) {
helpers do
def mobile_request?
mobile_user_agent_patterns.any? {|r| request.env['HTTP_USER_AGENT'] =~ r}
end
def mobile_user_agent_patterns
[
/AppleWebKit.*Mobile/,
/Android.*AppleWebKit/
]
end
$ /etc/init.d/apache2 restart
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Sun Feb 14 14:08:08 2010] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun Feb 14 14:08:08 2010] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun Feb 14 14:08:08 2010] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun Feb 14 14:08:08 2010] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun Feb 14 14:08:08 2010] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Sun