Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing 机器学习,模型算法。

krongk krongk

🎯
Focusing 机器学习,模型算法。
Block or report user

Report or block krongk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@krongk
krongk / meitu_xiuxiu_api.html.erb
Last active Aug 29, 2015
Rails4 Paperclip 集成美图秀秀 Web API 实现图片在线处理
View meitu_xiuxiu_api.html.erb
#本文目的:
# 实现新图片的添加、已添加图片的美化和拼图
#参考美图秀秀API
# http://open.web.meitu.com/products/#M2
# http://open.web.meitu.com/products/#M3
#最重要的这个文件
# views/site_images/_meitu_load.html.erb:
<script type="text/javascript">
@krongk
krongk / devise_omniauth_oauth2_tqq_douban_weibo.rb
Last active Feb 13, 2017
Devise + Omniauth + Oauth2 +(豆瓣、QQ、微博)
View devise_omniauth_oauth2_tqq_douban_weibo.rb
=begin
参考教程:http://www.douban.com/note/411359006/
Gem Omniauth(https://github.com/intridea/omniauth)
Gem omniauth-oauth2 (https://github.com/intridea/omniauth-oauth2)
流程参考:https://ruby-china.org/topics/6464
Devise and OmniAuth (revised) (http://railscasts.com/episodes/235-devise-and-omniauth-revised)
=end
# Gem lists
@krongk
krongk / Omniauth_Strategy_Weibo.rb
Last active Apr 2, 2017
Omniauth Strategy Weibo 新浪微博Oauth2
View Omniauth_Strategy_Weibo.rb
#C:\Sites\tm_wed\lib\omniauth\strategies\weibo.rb
# Updated at: 2014-09-04
# Author: we@wedxt.com
require 'omniauth-oauth2'
module OmniAuth
module Strategies
class Weibo < OmniAuth::Strategies::OAuth2
@krongk
krongk / Omniauth_Strategy_TQQ.rb
Last active Sep 19, 2016
Omniauth Strategy TQQ 腾讯QQ Oauth2
View Omniauth_Strategy_TQQ.rb
#C:\Sites\tm_wed\lib\omniauth\strategies\tqq.rb
# Updated at: 2014-09-04
# Author: we@wedxt.com
require "omniauth-oauth2"
module OmniAuth
module Strategies
class Tqq < OmniAuth::Strategies::OAuth2
@krongk
krongk / Omniauth_Strategy_Douban.rb
Last active Feb 7, 2017
Omniauth Strategy Douban 豆瓣Oauth2
View Omniauth_Strategy_Douban.rb
#C:\Sites\tm_wed\lib\omniauth\strategies\douban.rb
# Updated at: 2014-09-04
# Author: we@wedxt.com
require 'omniauth-oauth2'
module OmniAuth
module Strategies
class Douban < OmniAuth::Strategies::OAuth2
DEFAULT_SCOPE = 'douban_basic_common,shuo_basic_r,shuo_basic_w'
@krongk
krongk / nokogiri_test.rb
Last active Sep 5, 2015
A Nokogiri Demo test
View nokogiri_test.rb
require 'nokogiri'
require 'open-uri'
require 'iconv'
# define the html url
url="http://cd.58.com/wangzhanmeigong/"
#get the nokogiri document
doc = Nokogiri::HTML(open(url))
#new a file for save
file = File.new("c:/a.html","w")
@krongk
krongk / 5.timesdo
Last active Sep 3, 2015
5.times do
View 5.timesdo
5.times do
p 'hello'
end
You can’t perform that action at this time.