Skip to content

Instantly share code, notes, and snippets.

View Dockerfile
FROM httpd:2.4
ENV TDIARY_VERSION 5.0.7
WORKDIR /usr/local/apache2/htdocs
RUN apt-get update && apt-get install -y \
curl \
ruby \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
@machu
machu / jquery.socialbutton.js.patch
Created Aug 18, 2011
jQueryのソーシャルボタンプラグインを2回以上呼び出したときに、Google+ボタンがa表示されない問題へのパッチ
View jquery.socialbutton.js.patch
diff --git a/js/jquery.socialbutton.js b/js/jquery.socialbutton.js
index d4bb90c..03ca664 100644
--- a/js/jquery.socialbutton.js
+++ b/js/jquery.socialbutton.js
@@ -731,7 +731,11 @@ function socialbutton_google_plusone(target, options, defaults, index, max_index
script_params = '{' + script_params + '}';
}
- $('body').append('<script type="text/javascript" src="https://apis.google.com/js/plusone.js">' + script_params + '</script>');
+ if (typeof gapi === "undefined" || typeof gapi.plusone === "undefined") {
View section_footer2.rb.patch
Index: section_footer2.rb
===================================================================
--- section_footer2.rb (revision 38267)
+++ section_footer2.rb (working copy)
@@ -26,6 +26,31 @@
link
end
+unless defined?(subtitle)
+ def subtitle( date, index, escape = true )
View cached_pstore.rb
# = CachedPStore -- PStore extension w/ cache mechanism
#
# Copyright (C) 2010, MATSUOKA Kohei
# You can redistribute it and/or modify it under GPL2.
#
# == Usage examle:
#
# require 'cached_pstore'
#
# db = CachedPStore.new('test.dat', :expire => 3600) {|db, key|
View compatible.rb.patch
diff --git a/misc/lib/compatible.rb b/misc/lib/compatible.rb
index 6f5b5cf..9968536 100644
--- a/misc/lib/compatible.rb
+++ b/misc/lib/compatible.rb
@@ -34,23 +34,6 @@ unless "".respond_to?('each')
end
end
-# Auto convert ASCII_8BIT pstore data (created by Ruby-1.8) to UTF-8.
-if "".respond_to?('force_encoding')
View config.ru
require 'rubygems'
require 'rack/auth/twitter'
class ProtectedApp
def call(env)
Rack::Response.new("Hello, #{env['REMOTE_USER']}").finish
end
end
use Rack::Session::Pool, :expire_after => 2592000
View fcgid.conf
# This is the Apache server configuration file for providing FastCGI support
# through mod_fcgid
#
# Documentation is available at http://fastcgi.coremail.cn/doc.htm
LoadModule fcgid_module modules/mod_fcgid.so
# Use FastCGI to process .fcg .fcgi & .fpl scripts
# Don't do this if mod_fastcgi is present, as it will try to do the same thing
<IfModule !mod_fastcgi.c>
View safe.rb
module Safe
def safe( level = 4 )
result = nil
if $SAFE < level then
Proc.new {
$SAFE = level
result = yield
}.call
else
result = yield
View safe_spec.rb
# -*- coding: utf-8 -*-
require 'safe'
describe Safe, "safe mode module" do
before(:each) do
$SAFE = 1
ENV["sample"] = "default"
end