This file contains hidden or 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
require 'rubygems' | |
require 'coderay' | |
tokens = CodeRay.scan <<-'CODE', :ruby | |
puts %[Hello, world!] | |
puts "Here\'s some #@@weird #{ { :code => "for you" } }" | |
CODE | |
print tokens.div(:line_numbers => :table, :css => :class) |
This file contains hidden or 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
class AdminUser < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, | |
:recoverable, :rememberable, :trackable, :validatable | |
# Setup accessible (or protected) attributes for your model | |
attr_accessible :email, :login, :password, :password_confirmation, :remember_me | |
attr_accessor :login |
This file contains hidden or 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
GET /data/attachment/audioimg/8/143410hpzqo0oo5o2oimxm.jpg HTTP/1.1 - 15/Mar/2013:04:48:03 +0800 200 0.000 21863 21863 58.33.250.146 - - - - - iListen/1.5.01290 CFNetwork/609.1.4 Darwin/13.0.0sendfileon | |
GET /data/attachment/audioimg/0/141236mm3tlwv1wxrwhswr.jpg HTTP/1.1 - 15/Mar/2013:04:48:03 +0800 200 0.000 16130 16130 58.33.250.146 - - - - - iListen/1.5.01290 CFNetwork/609.1.4 Darwin/13.0.0sendfileon | |
GET /data/attachment/audioimg/0/142535uk7ee7uuuv6f7mh7.jpg HTTP/1.1 - 15/Mar/2013:04:48:03 +0800 200 0.000 26645 26645 58.33.250.146 - - - - - iListen/1.5.01290 CFNetwork/609.1.4 Darwin/13.0.0sendfileon | |
GET /data/attachment/audioimg/7/1705281f9seimc95gz544d.jpg HTTP/1.1 - 15/Mar/2013:04:48:04 +0800 200 1.440 24675 24675 112.78.65.211 - - - - - Dalvik/1.6.0 (Linux; U; Android 4.1.1; MI 2 MIUI/JLB12.0)sendfileon | |
GET /data/attachment/audio/0/143734o88bfyydy9aka5d8.audio HTTP/1.1 - 15/Mar/2013:04:48:04 +0800 206 44.649 1240599 1240599 87.0.131.142 - - - - - \xE6\x95\x85\xE4\xBA\x8B\xE5\x8F\xA3\xE8\xA2\x8B\xE5\x90\x |
This file contains hidden or 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
class SearchSuggestion | |
def self.terms_for(prefix) | |
return if prefix.blank? | |
puts "prefix:#{prefix}" | |
prefix_array = prefix.split | |
puts prefix_array | |
unless prefix_array.empty? | |
$redis.zinterstore "$tmp",prefix_array | |
terms = $redis.zrevrange "$tmp", 0, 4 |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
__author__ = 'Vincent Ting' | |
import cookielib | |
import urllib2 | |
import urllib | |
import json | |
import hashlib |
This file contains hidden or 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
226/2996 | |
2013-05-16 14:54:48 slug_audio_url:a/7/ywpqjh7l.audio | |
2013-05-16 14:54:48 uploading file:/w/apsqwezpre/www/a/7/ywpqjh7l.audio | |
2013-05-16 14:54:48 gen token | |
2013-05-16 14:54:48 uploading | |
D, [2013-05-16T14:54:48.713159 #10128] DEBUG -- : Initializing tmpfile: /tmp/Qiniu-RS-Ruby-SDK/a/7/ywpqjh7l.audio/progresses | |
D, [2013-05-16T14:54:48.713433 #10128] DEBUG -- : Initializing tmpfile: /tmp/Qiniu-RS-Ruby-SDK/a/7/ywpqjh7l.audio/ctxes | |
D, [2013-05-16T14:54:49.470966 #10128] DEBUG -- : Updating tmpfile: /tmp/Qiniu-RS-Ruby-SDK/a/7/ywpqjh7l.audio/progresses | |
D, [2013-05-16T14:54:49.471189 #10128] DEBUG -- : chunk 1 in block 0 successfully uploaded. | |
{:ctx=>"xmHnhZRx_-o7wrEr1pMSQgEG6oIJ0zFLXZcUN2xeLa-C3gtSjKksVQcQCFqSarOy1RAKBGmaw1HkKGiIMOJToEQUCJAsKZOIwEJbEGcIbDRax0vJpojL2IrsVsH6HGEJABKJHgAAAAAAAAQAAAAAAGkHAAC-BYlRAABAAAAABAACAAAABAD_____", :offset=>262144, :restsize=>3932160, :status_code=>200, :host=>"http://up-bj-3.qbox.me"} |
This file contains hidden or 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
2013-05-16 15:20:13 gen token | |
2013-05-16 15:20:13 uploading | |
W, [2013-05-16T15:21:14.059880 #23366] WARN -- : Request Timeout => Utils.http_request('http://up-bj-3.qbox.me/bput/likpaUITl60cqeYeiZRMLrIrYNuUfVeiZN1csSIKhqxi97SRgTHkSQGLC1KBAFC3YirCIAZQKZoEZhMY9yYEEX5LJiAOa3gEgiqGKBiuwCFAAsRj0zVtgomIjg0uXy76KDTw4wAAAAAAACAAAAAAAGkHAAC-BYlRAABAAAAAIAACAAAABAD_____/2097152') | |
W, [2013-05-16T15:21:14.259095 #23366] WARN -- : HTTP status code 701 => Utils.http_request('http://up-bj-3.qbox.me/bput/likpaUITl60cqeYeiZRMLrIrYNuUfVeiZN1csSIKhqxi97SRgTHkSQGLC1KBAFC3YirCIAZQKZoEZhMY9yYEEX5LJiAOa3gEgiqGKBiuwCFAAsRj0zVtgomIjg0uXy76KDTw4wAAAAAAACAAAAAAAGkHAAC-BYlRAABAAAAAIAACAAAABAD_____/2097152') | |
W, [2013-05-16T15:21:14.530586 #23366] WARN -- : HTTP status code 701 => Utils.http_request('http://up-bj-3.qbox.me/bput/likpaUITl60cqeYeiZRMLrIrYNuUfVeiZN1csSIKhqxi97SRgTHkSQGLC1KBAFC3YirCIAZQKZoEZhMY9yYEEX5LJiAOa3gEgiqGKBiuwCFAAsRj0zVtgomIjg0uXy76KDTw4wAAAAAAACAAAAAAAGkHAAC-BYlRAABAAAAAIAACAAAABAD_____/2097152') | |
W, [2013-05-16T15: |
This file contains hidden or 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
2013-05-22 11:12:42 audio_filename:a/7/ywpqjh7l.audio | |
2013-05-22 11:12:42 uploading file:/w/apsqwezpre/www/a/7/ywpqjh7l.audio | |
W, [2013-05-22T11:12:42.775132 #25685] WARN -- : HTTP status code 612 => Utils.http_request('http://rs.qbox.me/stat/YXBzMjphLzcveXdwcWpoN2wuYXVkaW8=') | |
2013-05-22 11:12:42 false | |
2013-05-22 11:12:42 gen token | |
2013-05-22 11:12:42 uploading | |
W, [2013-05-22T11:13:43.390193 #25685] WARN -- : Request Timeout => Utils.http_request('http://up-bj-3.qbox.me/bput/likpaUITl60cqeYeiZRMLrIrYNuUfVeiZN1csSIKhqxi97SRgTHkSQGLC1KBAFC3YirCIAZQKZoEZhMY9yYEEX5LJiAOa3gEgiqGKBiuwCFAAsRj0zVtgomIjg0uXy76KDTw4wAAAAAAACAAAAAAAGkHAAC-BYlRAABAAAAAIAACAAAABAD_____/2097152') | |
W, [2013-05-22T11:13:43.547051 #25685] WARN -- : HTTP status code 701 => Utils.http_request('http://up-bj-3.qbox.me/bput/likpaUITl60cqeYeiZRMLrIrYNuUfVeiZN1csSIKhqxi97SRgTHkSQGLC1KBAFC3YirCIAZQKZoEZhMY9yYEEX5LJiAOa3gEgiqGKBiuwCFAAsRj0zVtgomIjg0uXy76KDTw4wAAAAAAACAAAAAAAGkHAAC-BYlRAABAAAAAIAACAAAABAD_____/2097152') | |
W, [2013-05-22T11:13:43.764412 |
This file contains hidden or 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
# Call scopes directly from your URL params: | |
# | |
# @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
module Filterable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Call the class methods with the same name as the keys in <tt>filtering_params</tt> | |
# with their associated values. Most useful for calling named scopes from |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf8"> | |
<title>Float Label Pattern</title> | |
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> | |
<style type="text/css" media="screen"> | |
.row { | |
/*position: relative;*/ | |
padding-top: 24px; |
OlderNewer