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
<?xml version="1.0" encoding="utf-8"?> | |
<lfm status="ok"> | |
<results for="rage" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"> | |
<opensearch:Query role="request" searchTerms="rage" startPage="1" /> | |
<opensearch:totalResults>13989</opensearch:totalResults> | |
<opensearch:startIndex>0</opensearch:startIndex> | |
<opensearch:itemsPerPage>20</opensearch:itemsPerPage> | |
<trackmatches> | |
<track> | |
<name>Bombtrack</name> |
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
var Hoverer = { | |
current: null, | |
delay: 0.5, | |
timer: null, | |
handler: function(event) { | |
var element = event.findElement('div.nav_menu'); | |
if (!element) | |
return Hoverer.leave(); | |
if (element == Hoverer.current) |
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
function getScrollbarWidth() { | |
if (this.scrollbarWidth) { | |
return this.scrollbarWidth; | |
} | |
var inner = document.createElement('p'); | |
inner.style.width = '100%'; | |
inner.style.height = '200px'; | |
var outer = document.createElement('div'); | |
outer.style.position = 'absolute'; |
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
namespace :js do | |
desc "Pack javascript src for production environment" | |
task :pack => :environment do | |
# Files to pack | |
Dir.glob(File.join("public", "javascripts", "**", "*.js")).each do |filename| | |
puts "packing #{filename}..." | |
FileUtils.cp(filename, "#{filename}.orig") | |
js = "" | |
File.open(filename, "r") { |f| js = f.read } | |
File.open(filename, "w") { |f| f.write(Packr.pack(js, :shrink_vars => true, :private => true)) } |
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
.texpand { | |
margin: 0; | |
padding: 3px; | |
width: 298px; | |
height: 29px; | |
border: 1px solid rgb(189, 199, 216); | |
font-size: 12px; | |
color: rgb(119, 119, 119); | |
} |
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
# /config/environment.rb | |
config.gem "fermion-smugmugr", | |
:lib => 'smugmugr', | |
:source => 'http://gems.github.com', | |
:version => "=0.2.0" | |
# /config/initializers/smugmugr.rb | |
SMUG_CONFIG = { |
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
Many times, when creating a site, I need hidden elements on a page that I must later make visible. Of course it would be great if one could simply hide them via CSS, and later [easily] show them via javascript. However this is not the case, javascript has some difficulties overriding styles set in a stylesheet. So, I've found the best way to accomplish this is to use a combo of CSS and javascript in a two-step process: | |
1. Hide the elements via CSS class – so they are hidden when the user first sees the page | |
2. Hide the elements via javascript and remove the corresponding CSS class, after the DOM has loaded. | |
The second step has the potential to be quite expensive on the DOM, but feel that it's an acceptable trade-off because they elements in question are already hidden. This way they are ready to be manipulated, one doesn't need to worry about fiddling with CSS classes or styles. | |
## Stylesheet | |
.hidden { | |
display: none; |
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.slider.trackLength = Math.max(this.slider.maximumOffset(), this.slider.track.getHeight()) - this.slider.minimumOffset(); |
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
document.observeSelect = function(){ | |
$$('select.get').each(function(element){ | |
if(!element.observingChange){ | |
element.observe('change', function(event){ | |
var e = event.element(); | |
if(e.isActive()){ | |
e.indicate(); | |
document.ajaxRequest(e, e.readAttribute('src'), 'get', event, e.serialize()); | |
} | |
}); |
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
namespace :db do | |
task :pull do | |
run "cd #{current_release} && RAILS_ENV=#{rails_env} rake db:data:dump" | |
download "#{current_release}/db/data.yml", "db/data.yml" | |
`rake db:reset db:data:load` | |
end | |
end |
OlderNewer