后端工程师一名,目前主力语言是 Java 和 Ruby,熟悉的业务方向有区块链、交易所、微信小程序。
jiangyongkang / strikinglybackendtraining Goto Github PK
View Code? Open in Web Editor NEW:kiss: ┎愛┐、不夠〃德瞬〃間-\-/留┆8┆住的┾永遠┾ 曾〃經〃的〃美〃麗〃名〃叫〃牽〃挂
License: GNU General Public License v3.0
:kiss: ┎愛┐、不夠〃德瞬〃間-\-/留┆8┆住的┾永遠┾ 曾〃經〃的〃美〃麗〃名〃叫〃牽〃挂
License: GNU General Public License v3.0
Check out these gems we use (used, or potentially will use) for production environment and development:
Check out these critical gems we use in our product:
Check out these critical gems we use for BDD:
Checkout "Metaprogramming Ruby":
Ruby Object Model:
See Flo to discuss about your research and thoughts.
Read the following materials and get familiar with our workflow:
See Flo to discuss about rails large scale applications conventions
Our current architecture introduction:
This part will be covered by the backend training session. Please write down your questions if you have any._
Strikingly used to be hosted on Heroku. It is good to get some idea on our old architecture because we borrowed a lot of concepts and best practices from Heroku when designing our new architecture.
Here are some best practices on how to build a SaaS platform:
Play around with these 3rd party services we use in daily work:
Should be able to answer:
position: relative
and position: static
?em
units?Strikingly has a fairly sophisticated frontend system, be sure to familiarize yourself with the following technologies
https://github.com/airbnb/javascript/tree/master/es5 - Familiarize yourself with some basic javascript concepts. Take note that this is a style guide from AirBnb, we don't necessarily follow all the styles (we have our own in coffeescript), but it covers a lot of basic javascript concepts.
http://toddmotto.com/everything-you-wanted-to-know-about-javascript-scope/ - Javascript scoping is probably the most misunderstood part of the language. Having a very good command of it can give you the functional power of Javascript.
If you have more time, go to our library and grab Javascript the Good Parts and read it. Or, go here and read it on your computer: http://www.safaribooksonline.com Set up a trial account and check out the book.
Make sure you can answer the following questions before proceeding
All the new modules we write are in ES6, so please get familiar with it.
https://babeljs.io/docs/learn-es2015/ - Introduces ES6 features
https://github.com/strikingly/javascript - Our ES6 coding style
Make sure you can answer the following questions before proceeding
Task: Build a todo list with no use of flux or anything
Task: Build a todo list with the use of flux
Task: Build a todo list with morearty + flux.
Task: Build a todo list with redux
Make sure you can answer the following questions before proceeding
用于连接、简化、压缩静态资源文件,如:JavaScript
CSS
CofferScript
Sass
ERB
。而它是通过 sprockets-rails
这个 Gem 实现的。
GitHub 地址:https://github.com/rails/sprockets-rails
app/assets
文件夹用于储存应用自有的静态资源文件,例如自定义图像、JavaScript
文件和 CSS
文件。lib/assets
文件夹用于储存自有代码库的静态资源文件,这些代码库或者不适合放在当前应用中,或者需要在多个应用间共享。vendor/assets
文件夹用于储存第三方代码库的静态资源文件,例如 JavaScript
插件和 CSS
框架。如果第三方代码库中引用了同样由 Asset Pipeline
处理的静态资源文件(图像、CSS
文件等),就必须使用 asset_path
这样的辅助方法重新编写相关代码。// app/assets/javascripts/home.js
//= require home
// lib/assets/javascripts/moovinator.js
//= require moovinator
// vendor/assets/javascripts/slider.js
//= require slider
// vendor/assets/somepackage/phonebox.js
//= require phonebox
// app/assets/javascripts/sub/something.js
//= require sub/something
通过在 Rails 控制台中检查 Rails.application.config.assets.paths
变量,我们可以查看搜索路径。
$ rails c
Running via Spring preloader in process 65665
Loading development environment (Rails 4.2.0)
irb(main):003:0> Rails.application.config.assets.paths.each { |path| puts path }
/Users/vincent/demo/app/assets/images
/Users/vincent/demo/app/assets/javascripts
/Users/vincent/demo/app/assets/stylesheets
/Users/vincent/demo/vendor/assets/javascripts
/Users/vincent/demo/vendor/assets/stylesheets
/Users/vincent/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/jquery-rails-4.3.1/vendor/assets/javascripts
/Users/vincent/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/coffee-rails-4.1.1/lib/assets/javascripts
/Users/vincent/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/turbolinks-source-5.0.3/lib/assets/javascripts
所有的资源文件都默认的被加载在 app/assets/javascripts/application.js
或者 app/assets/stylesheets/application.css
文件中。
执行 rails assets:precompile
命令可以预编译静态资源文件
$ rails assets:precompile
yarn install v1.2.1
info No lockfile found.
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 📃 Building fresh packages...
info Lockfile not saved, no dependencies.
✨ Done in 0.04s.
I, [2017-11-02T14:35:11.039239 #65969] INFO -- : Writing /Users/vincent/development/strikingly-self-training-demos/advanced-rails-asset-pipeline-demo/public/assets/application-48e242c802bc1c1ff4f22b512e0cc49018bdddbceb47f2da7010dc7a1b5c8d15.js
I, [2017-11-02T14:35:11.050635 #65969] INFO -- : Writing /Users/vincent/development/strikingly-self-training-demos/advanced-rails-asset-pipeline-demo/public/assets/application-48e242c802bc1c1ff4f22b512e0cc49018bdddbceb47f2da7010dc7a1b5c8d15.js.gz
I, [2017-11-02T14:35:11.053435 #65969] INFO -- : Writing /Users/vincent/development/strikingly-self-training-demos/advanced-rails-asset-pipeline-demo/public/assets/application-961896ee152804be02f1f82f9e66a780981aaa888ef3315220e5aa24e815acc6.css
I, [2017-11-02T14:35:11.053579 #65969] INFO -- : Writing /Users/vincent/development/strikingly-self-training-demos/advanced-rails-asset-pipeline-demo/public/assets/application-961896ee152804be02f1f82f9e66a780981aaa888ef3315220e5aa24e815acc6.css.gz
先在 Gemfile
文件中添加用于压缩的 Gem
。
然后在 config/environments/production.rb
文件中添加或者修改压缩方式,比如采用 uglifier
进行压缩。
# config/environments/production.rb
config.assets.js_compressor = :uglifier
Puma 和 Unicorn 之间的性能差异并不是很大。感觉两个之间应用场景不同。
大型应用使用 Unicorn 更好一些,希望节省服务器资源的小型应用更适合用 Puma。
Unicorn 提供了很多通过信号控制进程的手段,方便系统管理员干预应用服务器运行。
在单进程模式下 Puma 只有1个工作进程,单 Unicorn 仍然会启动 master-worker 模式,因此Puma的单进程更节省内存。
Puma的线程可以根据请求自动伸缩,对于请求量小的应用,比较节省资源。
PS: Puma、Unicorn 的进程数量不要开太多,最好和 CPU 的核数相等即可。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.