This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
privatefilter.bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f(ra,n) | |
r=0 | |
ra.each {|x| r+=1 if x.include? n} | |
r | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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($) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ /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 |
OlderNewer