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 x = $(".content").find("a").each( | |
function(){ | |
var href = $(this).attr("href"); | |
if((!$(this).hasClass("drowsapMorphed")) && ($(this).next(".drowsapMorphed").length==0) && href && (href.indexOf('imgur')>=0 || href.indexOf('jpeg')>=0 || href.indexOf('jpg')>=0 || href.indexOf('png')>=0)){ | |
var ext = (href.indexOf('imgur')>=0 && href.indexOf('jpg')<0 && href.indexOf('png')<0) ? '.jpg' :''; | |
var img = $("<a class='drowsapMorphed' href='"+href+"' target='blank' style='display:block'><img style='display:block;max-width:780px;' src='"+href+ ext+"' /></a>"); | |
$(this).after(img); | |
} | |
} | |
); |
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
module Harmony | |
# Allows accessing config variables from harmony.yml like so: | |
# Harmony[:domain] => harmonyapp.com | |
def self.[](key) | |
unless @config | |
raw_config = File.read(RAILS_ROOT + "/config/harmony.yml") | |
@config = YAML.load(raw_config)[RAILS_ENV].symbolize_keys | |
end | |
@config[key] | |
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
class ApplicationController < ActionController::Base | |
helper :all # include all helpers, all the time | |
protect_from_forgery # See ActionController::RequestForgeryProtection for details | |
# Scrub sensitive parameters from your log | |
# filter_parameter_logging :password | |
before_filter :log_page_view, :except => [:destroy] | |
private |
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
/* Quick and easy way to make a webpage look good on an iPhone */ | |
<style type="text/css" media="only screen and (max-device-width: 480px)"> | |
body { width:90%; padding-right:0;} | |
h1 { margin-top:25px; } | |
p { width: 100%; } | |
</style> | |
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0" /> |
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
require 'rubygems' | |
require 'faker' | |
require 'Win32API' | |
require 'win32/clipboard' | |
include Win32 | |
=begin | |
= Lorem ipsum clipboard text for Windows | |
If you're using Windows and a quick launcher (like Launchy) you can use this script | |
to generate a paragraph of 'Lorem ipsum...' text and automatically copy it to your |
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
require 'rubygems' | |
require 'Win32API' | |
require 'win32/clipboard' | |
include Win32 | |
text = Clipboard.data | |
=begin | |
= Ruby script to remove crummy HTML |
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
awake: awoke | |
be: was | |
bear: bore | |
beat: beat | |
become: became | |
begin: began | |
bend: bent | |
beset: beset | |
bet: bet | |
bid: bid/bade |
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
accept | |
add | |
admire | |
admit | |
advise | |
afford | |
agree | |
alert | |
allow | |
amuse |
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).ready(function(){ | |
jQuery('a.rss-item').filter(function(){ | |
return this.hostname && this.hostname !== location.hostname; | |
}).each(function() { | |
var link = jQuery(this); | |
link.css('backgroundImage', 'url(' + 'http://s2.googleusercontent.com/s2/favicons?domain_url=' + escape('http://' + this.hostname) + ')'); | |
}); | |
}); |
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
<!-- using <object> (doesn't work in IE) --> | |
<object height="450" width="600" type="application/pdf" data="/attachment/hello.pdf"> | |
<h2>This content requires a PDF plugin</h2> | |
<p>View the PDF file here: <a href="/attachment/hello.pdf">hello.pdf</a></p> | |
</object> | |
<!-- using an iframe (does work in IE) pass options in the query string --> | |
<iframe height="900" width="99%" src="/attachment/hello.pdf#toolbar=0&scrollbar=0&navpanes=0"> </iframe> |
OlderNewer