Skip to content

Instantly share code, notes, and snippets.

diff --git a/vendor/gems/ngmoco-cache-money-0.2.12/lib/cash/accessor.rb b/vendor/gems/ngmoco-cache-money-0.2.12/lib/cash/accessor.rb
index dd2d56d..88f370d 100644
--- a/vendor/gems/ngmoco-cache-money-0.2.12/lib/cash/accessor.rb
+++ b/vendor/gems/ngmoco-cache-money-0.2.12/lib/cash/accessor.rb
@@ -17,7 +17,9 @@ module Cash
hits = repository.get_multi(*keys)
if (missed_keys = keys - hits.keys).any?
missed_values = block.call(missed_keys)
- hits.merge!(missed_keys.zip(Array(missed_values)).to_hash_without_nils)
+ misses = missed_keys.zip(Array(missed_values)).to_hash_without_nils
diff --git a/config/initializers/weibo_oauth.rb b/config/initializers/weibo_oauth.rb
index a117f98..1f46768 100644
--- a/config/initializers/weibo_oauth.rb
+++ b/config/initializers/weibo_oauth.rb
@@ -3,9 +3,51 @@ WEIBO_OAUTH.symbolize_keys!
module WeiboOAuth
class Client
- def upload(message, image)
- body, headers = http_multipart_data({:pic => image, :status => message})
function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
script.textContent = "(" + callback.toString() + ")();";
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
}
@yachi
yachi / siteisup.sh
Created November 4, 2011 06:57
有貨未
while sleep 15; do if [ `curl -s "http://store.apple.com/hk" |md5` != 3627b1dac6a928cfc587d5ac3be0654c ]; then open http://store.apple.com; fi done
add this to bookmark as a url
javascript:(function(){showcontent(window.location.href);})();
@yachi
yachi / yachi.vim
Created November 10, 2011 12:45
yachi .vimrc
filetype on " Automatically detect file types.
set nocompatible " We don't want vi compatibility.
" Add recently accessed projects menu (project plugin)
set viminfo^=!
" Minibuffer Explorer Settings
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
[["LSS", 15],
["SSL", 15],
["SLS", 17],
["LLS", 29],
["SSP", 34],
["SPS", 35],
["PSS", 35],
["SLL", 35],
["SSS", 37],
["LSL", 40],
@yachi
yachi / sprockets_debug.rb
Created June 18, 2012 08:52
sprokets compile debug
module Sprockets
class StaticCompiler
# def compile
# manifest = {}
# env.each_logical_path do |logical_path|
# next unless compile_path?(logical_path)
# if asset = env.find_asset(logical_path)
# manifest[logical_path] = write_asset(asset)
# end
@yachi
yachi / precompile.cap.rb
Created September 28, 2012 04:38
precompile rails 3 assets locally
namespace :deploy do
namespace :assets do
desc 'Run the precompile task locally and rsync with shared'
task :precompile, :roles => :web, :except => { :no_release => true } do
run_locally("bundle exec rake assets:precompile")
servers = find_servers_for_task(current_task)
port_option = port ? " -e 'ssh -p #{port}' " : ''
servers.each do |server|
run_locally("rsync --recursive --times --rsh=ssh --compress --human-readable #{port_option} --progress public/assets #{user}@#{server}:#{shared_path}")
end
package org.newsweb;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import org.springframework.web.client.RestTemplate;
import org.springframework.http.converter.StringHttpMessageConverter;
public class newsweb extends Activity