console.log("test")
This file contains hidden or 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
| $.ajax({ | |
| url: "/api/qiniubuckets/fudao/upload_token/", | |
| type: "POST", | |
| data: data, | |
| beforeSend: function (xhr) { | |
| xhr.setRequestHeader( | |
| "Authorization", "JWT {{jwt_token}}"); | |
| xhr.setRequestHeader("X-Mobile", "false"); | |
| } | |
| }) |
This file contains hidden or 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
| # https://docs.djangoproject.com/en/2.1/topics/cache/#the-low-level-cache-api | |
| from django.core.cache import cache | |
| # 设定值,省略timeout默认为300秒 | |
| cache.set("key_name", "value", timeout=300) | |
| # 设定值,nx=True意思是只有这个key不存在时,才创建,也就是不会覆盖已经有的key | |
| cache.set("key", "value1", nx=True) |
This file contains hidden or 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
| import hashlib | |
| with open('test.txt', 'rb') as f: | |
| m = hashlib.md5() | |
| m.update(f.read()) | |
| md5value = m.hexdigest() |
This file contains hidden or 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
| from urllib.parse import urlparse | |
| from urllib.parse import urlunparse | |
| def update_url(url): | |
| o = urlparse(url) | |
| new_o = ('http', 'media.lqdimg.com', o.path, o.params, o.query, o.fragment) | |
| new_url = urlunparse(new_o) | |
| return new_url |
This file contains hidden or 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
| # 开发过程中的本地调试 | |
| ## 快速了解 | |
| 在开发 Web 应用的时候,通常我们会在本地(自己开发时使用的电脑)上运行正在写的程序,随时访问,出了问题可以立刻看到并修改。 | |
| 但是开发微信应用时,我们没法继续使用这样的方式来开发,因为微信需要能够访问到我们的程序,如果每次做了一点修改都要把代码部署到服务器上,太麻烦了,所以我们需要想办法做到只在本地开发,就可以进行调试。 | |
| 下面讲解两种处理这个问题的思路和方法。 |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>name</key> | |
| <string>Solarized (dark)</string> | |
| <key>settings</key> | |
| <array> | |
| <dict> | |
| <key>settings</key> |
This file contains hidden or 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
| { | |
| "animation_enabled": false, | |
| "auto_complete": true, | |
| "auto_complete_commit_on_tab": false, | |
| "auto_complete_delay": 50, | |
| "auto_complete_selector": "source - comment", | |
| "auto_complete_size_limit": 4194304, | |
| "auto_complete_triggers": | |
| [ | |
| { |
This file contains hidden or 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
| patch: | |
| "style/color_scheme": ink | |
| "style/font_face": "HiraginoGB" | |
| "style/font_point": 14 | |
| app_options/com.googlecode.iterm2: | |
| ascii_mode: true | |
| app_options/com.alfredapp.Alfred: | |
| ascii_mode: true | |
| app_options/com.apple.Xcode: | |
| ascii_mode: true |
This file contains hidden or 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
| patch: | |
| "menu/page_size": 5 |
NewerOlder