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
$("<%= escape_javascript render(:file => 'comments/new.html.erb') %>").insertAfter('#comments'); | |
$('#new_comment').slideDown(); | |
$('#new_comment_link').hide(); |
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 'open-uri' | |
if Dir[@store_path+"*"].empty? | |
`rmdir #{@store_path}` | |
end | |
File.basename(url) |
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 (-f $request_filename) { | |
break; | |
} | |
if (-f $document_root/cache/$uri/index.html) { | |
rewrite (.*) /cache/$1/index.html break; | |
} | |
if (-f $document_root/cache/$uri.html) { | |
rewrite (.*) /cache/$1.html break; |
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
url = "http://www.wikipedia.org" | |
doc = Nokogiri::HTML(open(url)) | |
icon = doc.search("link[@rel='shortcut icon']") | doc.search("link[@rel='icon']") | |
@icon_urls = icon.map {|i| i.attributes["href"].value()} |
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 RecordingEpg | |
RSID = "SCSP" | |
TSID = "ISPACE DS" | |
def self.get_epg(args={}) | |
args = { | |
:spid => $rca_config[:kuanyun_spid], | |
:appid => $rca_config[:kuanyun_appid], | |
:time_stamp => Date.today.to_time.strftime('%Y-%m-%d %H:%M:%S'), |
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
On only two scores can The Economist hope to outdo its rivals | |
consistently. One is the quality of its analysis; the other is the quality | |
of its writing. The aim of this book is to give some general advice on | |
writing, to point out some common errors and to set some arbitrary | |
rules. | |
The first requirement of The Economist is that it should be readily | |
understandable. Clarity of writing usually follows clarity of thought. | |
So think what you want to say, then say it as simply as possible. Keep | |
in mind George Orwell’s six elementary rules (“Politics and the English | |
Language”, 1946): |
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
# Place all the behaviors and hooks related to the matching controller here. | |
# All this logic will automatically be available in application.js. | |
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ | |
$ -> | |
$("form#form_test").bind "ajax:success",(data, cdata, xhr) -> | |
if cdata.status is 0 | |
alert("ss") | |
tmpl = $('#tmpl-item').html() | |
todoItemHTML = (id, txt) -> |
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
main = exports ? this | |
main.searchLocations = (brand, cities...) -> | |
a = "looking for #{brand} in #{cities.join(',')}" | |
console.log(a) | |
class main.Coffee | |
constructor: (@name, @strength=1) -> | |
$("i.icon-leaf").click => | |
console.log(@name) | |
brew: -> alert "brewing #{@name}" | |
pour: (amount=@strength) -> |
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
$.fn.vod_player = (options) -> | |
timeFormat = (seconds) -> | |
m = if Math.floor(seconds/60) < 10 then ("0" + Math.floor(seconds/60)) else Math.floor(seconds/60) | |
s = if Math.floor(seconds-(m*60)) < 10 then ("0" + Math.floor(seconds-(m*60))) else Math.floor(seconds-(m*60)) | |
m + ":" + s | |
defaults = | |
width: 1280 | |
height: 720 | |
source: "http://itstreaming.apple.com/podcasts/apple_keynotes_1080p/2012_oct_1080_CC.m4v" | |
type: 'video/mp4' |
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
#cover | |
width: 600px | |
padding: 40px | |
position: absolute | |
left: 0 | |
-webkit-perspective: 920px | |
-webkit-perspective-origin: 50% 50% | |
.cover-frame | |
position: relative | |
width: 333px |
OlderNewer