Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
ChinaRegions provides Ruby on Rails code for provinces, cities, and districts [prefecture-level cities] in China. The code need to requires Ruby (> 1.9.x) and Rails (> 4.0).
If you are using ChinaRegions version 0.1.x be sure to run:
rails g china_regions:regions
to have the javascript file copied over into your project.
Add it to your Gemfile:
gem 'china_regions'
Run the following command to install it:
bundle install
Run the generator:
rails g china_regions:install
Then you can see the changes that happened to the console:
db/migrate/xxxxxxxxxxx_create_china_regions_tables.rb
to db/migrate
folder.regions.en.yml
and regions.zh.yml
files to config/locales
foldersCreate tables (provinces, cities, districts):
rake db:migrate
Copy Models [Province
, City
, District
] into your project:
rails g china_regions:regions
Newly added models:
Download and import the latest regions to your project:
rake china_regions:all
OR
rake china_regions:download
rake china_regions:import
Administrative-divisions-of-China
to db/regions
folder.
Example:
= form_for @article do |f|
= f.region_select [:province, :city, :district]
# form_tag
= region_select :article, :province_id
= region_select :article, :city_id
= region_select :article, :district_id
OR
= region_select :article, :province
= region_select :article, :city
= region_select :article, :district
= f.submit class: 'btn'
Add prefix name:
= form_for @article do |f|
= f.region_select [:province, :city, :district], :prefix => "home"
= f.region_select [:province, :city, :district], :prefix => "work"
Pre-selected province:
= form_for @article do |f|
= f.region_select [:province, :city, :district], province: "chongqing"
OR
= f.region_select [:province, :city, :district], province: "重庆市"
Prior choice:
= form_for @article do |f|
= f.region_select [:province, :city, :district],
priority: {
province: ["重庆市"],
district: %w(巴南区 北碚区 渝北区)
}
We have a list of valued contributors. Check them all at: https://github.com/encoreshao/china_regions/graphs/contributors
Copyright © 2020-02 Encore Shao. See LICENSE for details.
FAQs
Unknown package
We found that china_regions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.