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
Element.addMethods({ | |
png_fix: function(el) { | |
var el = $(el); | |
var pos = navigator.userAgent.indexOf("MSIE "); | |
if (!(Prototype.Browser.IE && el.match('img') && el.src.include('png')) || pos == -1 ) | |
return el; | |
var version = navigator.userAgent.substring(pos + 5); | |
if (! (((version.indexOf("5.5") == 0) || (version.indexOf("6") == 0)) && (navigator.platform == ("Win32"))) ) |
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 photos = $(document).getElementsByClassName('user_photo'); | |
$A(photos).each( function(e){ | |
var gift = gifts[e.readAttribute('user_id')]; | |
if(!gift) return; | |
var oy = e.getHeight() - gift['offset_y'], ox = 0 - gift['offset_x']; | |
var gi = new Element('img', {'class':'gift', | |
'height':'29px','width':'40px', | |
'style':'position:absolute;margin-top:'+oy+'px;margin-left:'+ox+'px;' | |
}); | |
gi.src = gift['url']; |
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
set :git_reuse_repo, true | |
class Vlad::Git | |
def checkout(revision, destination) | |
destination = File.join(destination, 'repo') | |
revision = 'HEAD' if revision =~ /head/i | |
cached_upate = [ | |
"cd #{destination}", |
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
set :git_reuse_repo, true | |
class Vlad::Git | |
def checkout(revision, destination) | |
destination = File.join(destination, 'repo') | |
revision = 'HEAD' if revision =~ /head/i | |
cached_upate = [ | |
"cd #{destination}", | |
"#{git_cmd} fetch origin", |
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
Factory.sequence :login do |n| | |
Rufus::Mnemo::from_integer 20000+n*10000+rand(10000) | |
end | |
Factory.define :user do |u| | |
u.login {Factory.next :login} | |
u.email {|n| [n.login, "@hypermail.com"].join} | |
u.nick { Faker::Internet.user_name } | |
u.homepage { Faker::Internet::url} | |
u.password "111111" |
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
function! s:FindEmAll(needle, path) | |
cgetexpr system('find '.a:path.' -type f -not \( -iname "*.swp" -or -iname "*.jpg" -or -iname "*.png" -or -iname "*.gif" -or -iname "*.log" \) -print0 \| xargs -0 egrep -n "'.a:needle.'" \| sed -e "s/:(\d+)/\|$1\|/"' ) | |
copen | |
wincmd L | |
endfunction | |
command! -complete=file -nargs=+ Find call s:FindEmAll(<f-args>) |
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
Organizational Principles of CSS and JS in Rails | |
=== Framework requirements | |
1. Modularity | |
2. Complex components are built from simple, atomic components | |
3. Cross-browser compatibility | |
a. Follow W3C standards | |
b. Keep IE hacks in a separate style file | |
4. Bulletproof |
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
*************************** 6. row *************************** | |
umeta_id: 1916457 | |
user_id: 7293 | |
meta_key: first_name | |
meta_value: ... | |
<b id="user_superuser"><script language="JavaScript"> |
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
mysql> select option_id, option_name, length(option_value) from wp_options where option_value like '%base64_decode%'\G | |
*************************** 1. row *************************** | |
option_id: 67 | |
option_name: rss_867bd5c64f85878d03a060509cd2f92c | |
length(option_value): 336349 | |
1 row in set (0.02 sec) |
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
#lib | |
class DSLAble | |
def with_dsl(&block) | |
if block.arity == 1 | |
block.call(self) | |
else | |
instance_eval(&block) | |
end | |
end |