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
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
public class MountainCipher | |
{ | |
private int numberOfChars; // number of chars in the plaintext | |
private int[] plainText; // array of plain text ASCII codes | |
private int[] cipherText; // array of cipher text ASCII codes | |
private String plainFile; // name of plaintext file |
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
get '/feed', :agent => /FeedBurner (\d\.\d)[\d\/]*?/ do | |
@posts = Post.reverse_order(:created_at).limit(20) | |
content_type 'application/atom+xml', :charset => 'utf-8' | |
builder :feed | |
end | |
get '/feed' do | |
redirect Blog.feedburner_url | |
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
/*************************************** | |
"The Final Frontier" Web Store (Assignment 1) | |
Author: John Dyer | |
Class: CS401 | |
Section: Wednesday | |
Version: 1.0 | |
Date: 9/24/09 | |
Description: Basic simulation of an "online" store with it's theme being the Final Frontier. | |
****************************************/ | |
import java.util.*; |
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
if Rails.env.production? | |
ENV['RECAPTCHA_PUBLIC_KEY'] = 'your_production_key' | |
ENV['RECAPTCHA_PRIVATE_KEY'] = 'your_production_key' | |
else | |
ENV['RECAPTCHA_PUBLIC_KEY'] = 'your_global_key' | |
ENV['RECAPTCHA_PRIVATE_KEY'] = 'your_global_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
$('ul .tags').each(function() { | |
$(this).children('li:gt(4)').hide(); | |
$('li:4').after('<li><a href="#" class="show-hide-tags" data-open="0">[More]</a></li>'); | |
}); | |
$('.show-hide-tags').click(function(e) { | |
e.preventDefault(); | |
var $this = $(this); | |
if ($this.attr('data-open') == "0") { | |
$this.text("[Less]"); |
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
} | |
.tags { | |
position: absolute; | |
display: block; | |
} | |
.tags li { | |
bullet-style: none; | |
display: inline; | |
} | |
.show-hide-tags { |
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
// --------------------------------------------------------------------------------- | |
// TAGGING | |
// --------------------------------------------------------------------------------- | |
$('ul.tags').each(function() { | |
$(this).children('li:gt(4)').hide(); | |
$(this).after(' <p class="show-hide-tags"><a href="#" data-open="0">[More]</a></p>'); | |
}); | |
$('.show-hide-tags a').click(function(e) { |
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 HTML | |
class StathamSanitizer < WhiteListSanitizer | |
protected | |
def tokenize(text, options) | |
super.map do |token| | |
if token.is_a?(HTML::Tag) && options[:parent].include?(token.name) | |
token.to_s.gsub(/</, "<") | |
else |
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
$('ul.tag-list').each(function() { | |
if($(this).children('li').size() > 5) { | |
$(this).children('li:gt(4)').hide(); | |
$(this).after(' <p class="show-hide-tags"><a href="#" data-open="0"> [More]</a></p>'); | |
} | |
}); | |
$('.show-hide-tags a').click(function(e) { | |
e.preventDefault(); | |
var $this = $(this); |
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
$('.suggested-tags li a').click(function(e) { | |
if($('.tag-box').attr('data-empty') == 0) { | |
var tag_text = ', ' + $(this).text(); | |
}else { | |
var tag_text = $(this).text(); | |
$('.tag-box').attr('data-empty', '0'); | |
} | |
e.preventDefault(); | |
$('.tag-box input:text').val($('.tag-box input').val() + tag_text); |
OlderNewer