Skip to content

Instantly share code, notes, and snippets.

View pokka's full-sized avatar
🌮
I may be slow to respond.

Pokka pokka

🌮
I may be slow to respond.
View GitHub Profile
@pokka
pokka / wechat-browser-detect.js
Last active May 31, 2017 01:49 — forked from cary929/wechat-browser-detect.js
JavaScript 判断是否微信内置浏览器
// 使用 userAgent 判断是否微信内置浏览器
if( navigator.userAgent.toLowerCase().indexOf('micromessenger') > -1 || typeof navgator.wxuserAgent !== "undefined" ) {
return true;
}
@pokka
pokka / Ruby STRFTIME conversion formats.rb
Last active September 7, 2015 03:06 — forked from akshaymohite/Ruby STRFTIME conversion formats.rb
Ruby script to print out strftime conversion format options and outputs
# Function to print strftime results
def print_strftime_formats(a,cur_date)
a.each do |format|
b = "%#{format}"
output = cur_date.strftime(b)
puts "t.strftime('#{b}'), => #{output}"
end
end
a = ('a'..'z').to_a
skip_filter *_process_action_callbacks.map(&:filter), :only => [:action_goes_here]
@pokka
pokka / Guthrie IP.md
Created September 12, 2013 10:35 — forked from holman/Guthrie IP.md

This song is Copyrighted in U.S., under Seal of Copyright # 154085, for a period of 28 years, and anybody caught singin it without our permission, will be mighty good friends of ourn, cause we don’t give a dern. Publish it. Write it. Sing it. Swing to it. Yodel it. We wrote it, that’s all we wanted to do.

  • Woody Guthrie, 1940's —
namespace :deploy do
task :setup_solr_data_dir do
run "mkdir -p #{shared_path}/solr/data"
end
end
namespace :solr do
desc "start solr"
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec sunspot-solr start --port=8983 --data-directory=#{shared_path}/solr/data --pid-dir=#{shared_path}/pids"