Skip to content

Instantly share code, notes, and snippets.

View mozillo's full-sized avatar
💭
I may be slow to respond.

Initial M mozillo

💭
I may be slow to respond.
View GitHub Profile
@mozillo
mozillo / bzy.rb
Created July 21, 2019 05:46
八爪鱼 ruby 接口
class Bzy
BASE_URI = "https://dataapi.bazhuayu.com".freeze
attr_reader :username, :password, :token_path
def initialize(username, password, token_path)
@username = username
@password = password
@token_path = token_path
end
在web端输入报错信息,生成提问二维码,公众号扫描,然后进入问题专题
======= Prolbem =================================================================================================================
I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute:
rake db:create , command I get:
PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.
: CREATE DATABASE "my_db_name" ENCODING = 'unicode'.......
bin/rake:16:in `load'
@mozillo
mozillo / index.md
Created September 1, 2016 03:55 — forked from rstacruz/index.md
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@mozillo
mozillo / rspec_model_testing_template.rb
Created January 20, 2016 14:25 — forked from PWSdelta/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@mozillo
mozillo / TabBarAndroid
Created December 22, 2015 03:56
TabBarAndroid
import React, {
Component,
Navigator,
View,
Text,
Image,
TouchableOpacity,
StyleSheet
} from 'react-native';
import assets from './assets';