This file contains hidden or 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 'facebook_feed' | |
class GroupFeedAnalyzer | |
def initialize | |
end | |
private | |
def download_entire_feed | |
unless not feed_downloader.has_more_pages? | |
This file contains hidden or 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
Client.java | |
/* ------------------ | |
Client | |
usage: java Client [Server hostname] [Server RTSP listening port] [Video file requested] | |
---------------------- */ | |
import java.io.*; | |
import java.net.*; | |
import java.util.*; |
This file contains hidden or 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
Server.java | |
/* ------------------ | |
Server | |
usage: java Server [RTSP listening port] | |
---------------------- */ | |
import java.io.*; | |
import java.net.*; |
This file contains hidden or 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 RubyLang | |
end | |
class Computer | |
def self.my_attr_reader(name) | |
if name.is_a? Symbol | |
puts "is symbol" | |
else | |
puts "is string" | |
end |
This file contains hidden or 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 SuggestionController = { | |
_init: function() { | |
SuggestionController.queryInput = document.getElementById("query"); | |
SuggestionController.suggestionsOutput = document.getElementById("suggestions"); | |
SuggestionController.queryInput.addEventListener("keyup", SuggestionController.handleKeyup); | |
}, | |
generateSuggestions: function(list, input) { | |
if (input === "") | |
return []; |
This file contains hidden or 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
<html> | |
<head> | |
<script src="./suggestions.js" type="text/javascript"></script> | |
<title></title> | |
</head> | |
<body> | |
<input id="query" name="query" type="text"> | |
<ul id="suggestions"> | |
</ul> | |
</body> |
This file contains hidden or 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
// Version A: Works | |
WO.workouts = { | |
init: function() { | |
WO.workouts.index.init(); | |
} | |
}; | |
WO.workouts.index = { | |
init: function() { | |
$('.calendar td').click(function(){ |
This file contains hidden or 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 Time | |
def weekday? | |
days = %w(Monday Tuesday Wednesday Thursday Friday) | |
days.each do |day| | |
return true if __send__("#{day.downcase}?") | |
end | |
false | |
end | |
end |
This file contains hidden or 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 | |
rails_env = Rails.env.production? ? 'PROD' : Rails.env[0...3].downcase | |
current_app = Dir.pwd.split('/').last.capitalize | |
IRB.conf[:PROMPT].reverse_merge!(:RAILS_ENV => {:PROMPT_I=>"#{current_app} #{rails_env} >> ", :PROMPT_N=>"#{current_app} #{rails_env} >> ", :PROMPT_S=>nil, :PROMPT_C=>"?> ", :RETURN=>"=> %s\n"}) | |
IRB.conf[:PROMPT_MODE] = :RAILS_ENV | |
end |
This file contains hidden or 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 './jsobject' | |
# js = JSObject.new('{"carson":"tang"}') | |
require 'json' | |
class JSObject | |
attr_accessor :js_object | |
def initialize(json) | |
hash = JSON.parse(json) | |
@js_object = hash2jsobject(hash) |
OlderNewer