- https://speakerdeck.com/willroth/50-laravel-tricks-in-50-minutes
- https://www.reddit.com/r/laravel/comments/3to60i/50_laravel_tricks/
- 1. Automatic Model Validation
const MY_DOMAIN = "agodrich.com" | |
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2" | |
const DISQUS_SHORTNAME = "agodrich" | |
addEventListener('fetch', event => { | |
event.respondWith(fetchAndApply(event.request)) | |
}) | |
const corsHeaders = { | |
"Access-Control-Allow-Origin": "*", |
背景: 折腾了一整个周末,终于把用通过微信进行获取用户信息,以用来进行账号注册登录的问题搞定了, 因为面对的问题比较棘手: 希望通过微信订阅号获取用户信息授权,在自己开放的网站(所谓第三方网站)拿到用户信息, 所以在解决问题的过程中,顺便把自己期望实现的方式,以及现有的方式也稍微了解了一些, 所以趁此机会做一个整理。 因为朋友的网站是 php 开发的,所以下面的代码会以 php 进行举例,尽管我对 php 并不熟悉, 但是现在懒得重新去实现一遍了, 后面再说吧, 如果有后面的话。 其实其他语言理论上可以很容易类比, 因为微信的这些接口都是 restful 的 http 接口。
微信授权登陆, 从使用入口来说,主要是 PC 端网站, 移动端网站和 APP。 这里的“移动端网站”是指从微信浏览器打开的网站,如果从手机浏览器打开, 那么只能与PC端的授权方式一样(实际上操作很麻烦) 基本的授权方式如下:
以上两种方式基本可以通过微信开放平台实现。
ffmpeg -ss $INPUT_START_TIME -t $LENGTH -i $INPUT_FILENAME \ | |
-vf "fps=$OUTPUT_FPS,scale=$OUTPUT_WIDTH:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \ | |
-loop $NUMBER_OF_LOOPS $OUTPUT_FILENAME | |
# Change these placeholders: | |
# * $INPUT_START_TIME - number of seconds in the input video to start from. | |
# * $LENGTH - number of seconds to convert from the input video. | |
# * $INPUT_FILENAME - path to the input video. | |
# * $OUTPUT_FPS - ouput frames per second. Start with `10`. | |
# * $OUTPUT_WIDTH - output width in pixels. Aspect ratio is maintained. |
# First let's update all the packages to the latest ones with the following command | |
sudo apt update -qq | |
# Now we want to install some prerequisite packages which will let us use HTTPS over apt | |
sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq | |
# After that we will add the GPG key for the official Docker repository to the system | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
# We will add the Docker repository to our APT sources |