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
#!/bin/bash | |
# | |
# Download and install libevent and memcached from source on Debian Etch or | |
# Debian Lenny. | |
# | |
# Assumptions | |
# - libevent and memcached have not been installed from apt repositories | |
# - memcached is not already running | |
# - it is ok to clobber scripts at | |
# /etc/memcached.conf |
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 ActiveModel | |
module Translation | |
include ActiveModel::Naming | |
def human_attribute_name(attribute, options = {}) | |
options = { :count => 1 }.merge!(options) | |
parts = attribute.to_s.split(".") | |
attribute = parts.pop | |
namespace = parts.join("/") unless parts.empty? | |
attributes_scope = "models" |
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('ajax:error', function(e, xhr, status, errors){ | |
var error; | |
try { | |
error = $.parseJSON(xhr.responseText); | |
} catch(e) { | |
error = {message: '服务器忙,请稍后再试!'}; | |
} | |
//code to show error message |
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
function getSelectionText() { | |
var text = ""; | |
if (window.getSelection) { | |
text = window.getSelection().toString(); | |
} else if (document.selection && document.selection.type != "Control") { | |
text = document.selection.createRange().text; | |
} | |
return text; | |
} |
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
body { | |
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif | |
font-size: 14px; | |
color: #333333; | |
line-height: 20px; | |
} |
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
function GetWidth() | |
{ | |
var x = 0; | |
if (self.innerHeight) | |
{ | |
x = self.innerWidth; | |
} | |
else if (document.documentElement && document.documentElement.clientHeight) | |
{ | |
x = document.documentElement.clientWidth; |
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 Object | |
def eigenclass | |
class << self; self; end | |
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
a { | |
display: inline-block; | |
text-overflow: ellipsis; | |
width: 20em; | |
white-space: nowrap; | |
overflow: hidden; | |
} |
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
/* Solarized Dark | |
For use with Jekyll and Pygments | |
http://ethanschoonover.com/solarized | |
SOLARIZED HEX ROLE | |
--------- -------- ------------------------------------------ | |
base03 #002b36 background | |
base01 #586e75 comments / secondary content |
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
&:after { | |
content: "."; | |
display:block; | |
height:0; | |
clear:both; | |
visibility:hidden; | |
} |
OlderNewer