This file contains 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
<image class='图片position:relative' src="{{例子}}" bind:tap='click_image' mode='widthFix'> | |
<view catch:tap='删除标签函数' data-tag="{{i}}" class='tag_on_image' wx:key="{{i}}" wx:for='{{tag_array}}' wx:for-item='i' data-item='{{i}}' style="position:absolute; left:{{i.x}}px;top:{{i.y}}px;"> | |
{{i.name}} | |
</view> | |
</image> |
This file contains 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
echo "Hello Ghost from Github" |
This file contains 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
// Step 1: visit | |
// https://www.reddit.com/subreddits/ | |
// Step 2: | |
// copy & past these into Chrome developer tool | |
var array = [] | |
document.querySelectorAll('.subscription-box ul li').forEach(function(element) { | |
var subreddit = element.querySelector('a[class="title"]') | |
subreddit_name = subreddit.innerText |
This file contains 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
var original = $('#playlist tr span').text().split('\n') | |
original.splice(0,1) | |
var res = original.filter((element, index) => { | |
return index % 2 == 0; | |
}) | |
var result = res.map(s => s.trim()); | |
result.join('\n') |
This file contains 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
$("#camera-controller").on("touchstart", (e) => { | |
var fingerOnScreen = e.originalEvent.targetTouches.length; | |
$('#finger_count').text(fingerOnScreen); | |
}); | |
$("#camera-controller").on("touchend", (e) => { | |
var fingerOnScreen = e.originalEvent.targetTouches.length; | |
$('#finger_count').text(fingerOnScreen); | |
}); |
This file contains 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
// 微信小程序,内容安全示例代码 | |
const qiniuUploader = require("../../utils/qiniuUploader.js"); // https://github.com/gpake/qiniu-wxapp-sdk | |
const wittcism = require('../../utils/wittcism.js') // API | |
Page({ | |
data: {}, | |
onShow() {}, | |
change_avatar() { | |
qiniuUploader.upload(filePath, (res) => { | |
var original_qiniu_link = res.qiniu_url |
This file contains 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
<template lang='pug'> | |
// 社交媒体账号 | |
.box-icon-line | |
.icon.wechat(@click='wechat_click') | |
img(src='/static/app-image/icon-wechat-color.png', alt='wechat icon') | |
</template> | |
<script> | |
export default { |
This file contains 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
<!-- 微信登录:电脑端的 redirect_uri, 接收到来自微信的 code, 然后这个页面负责做下一步操作(把 code 传给后端)--> | |
<template lang='pug'> | |
#root | |
.hint | |
h3 | |
| {{message}} | |
</template> | |
<script> | |
import { mapGetters, mapActions } from 'vuex'; |
This file contains 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
/* | |
用户的头像 url 有3种可能: | |
1. 空 | |
代表是默认头像 | |
2. avatar-2018-07-24-16-26-52-Fs0NsdbSY8dPPvJjiXFKs-M8ISLG.jpg | |
代表是用户自定义头像,前面要加上 https://img.wittcism.com | |
3. https://wx.qlogo.cn/mmopen/vi_32/Da3any5kia1kePickTDzlMJTRQMFJbaebPebFlicbXF6WkT6vH325DDGcNm3zNZX1r4Wtpg7ZjUarezKPVvV8bHpw/132" | |
代表是微信登录的头像 | |
avatar 这个 filter 要进行正确的处理,3种情况下都返回正确的 URL |
This file contains 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
# For Safety | |
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; | |
add_header Content-Security-Policy "default-src https: data: 'unsafe-inline' 'unsafe-eval'" always; | |
add_header X-Frame-Options "SAMEORIGIN" always; | |
add_header X-Xss-Protection "1; mode=block" always; | |
add_header X-Content-Type-Options "nosniff" always; | |
server_tokens off; | |
add_header Referrer-Policy "no-referrer-when-downgrade"; | |
add_header Feature-Policy "midi none;notifications none;push none;sync-xhr none;microphone none;camera none;magnetometer none;gyroscope none;speaker self;vibrate none;fullscreen self;payment none;"; | |
# Sources: |