这个徽章需要由你在 Discussion Q&A 中回答别人的问题,并且由 OP(不能是你自己)mark as answer 才能获得。需要至少回答两个问题。
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
package main | |
import "github.com/gin-gonic/gin" | |
func main() { | |
r := gin.Default() | |
r.GET("/users/:name", func(c *gin.Context) {}) | |
// can't use `:id` here, change to `:name` will fix the confliction | |
r.GET("/users/:id/repos", func(c *gin.Context) {}) | |
_ = r.Run(":8080") |
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
#include <iostream> | |
#include <chrono> | |
#include <sstream> | |
using namespace std; | |
using namespace chrono; | |
// Method 1: Using a conditional operator | |
string bool_to_string_conditional(bool b) { | |
return b ? "true" : "false"; |
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
from threading import Event, Thread | |
event1 = Event() | |
event2 = Event() | |
event3 = Event() | |
i = 0 | |
def f1(): | |
global i |
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
# -*- coding: utf-8 -*- | |
# Created by johnj at 2019/12/19 | |
""" | |
批量 block 用中文污染 issue 的人 | |
需要设置 USERNAME 和 TOKEN 两个环境变量 | |
USERNAME 为 GitHub 用户名 | |
TOKEN 获取参考这里:# https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line | |
""" |
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
<?php | |
return sg_load('0A01FEFE4CDFE8DCAAQAAAAXAAAABGgAAACABAAAAAAAAAD/sFFonI5E/xv0Nvko1nt1cGvdcCQ4+0AB/9a1drcirnIeprf0fSXAGndgenGD2Ms2f8fi/9yfLRReY4diC1jorYd5LwPpUowSHZHD8Dd099AqqgbALH0AB3A3LUKyPQ7926nUlY7+bY5HAAAA0HoAACjRDNeVsiYzLV1PKBsL2t0MHQ775l6xpFj0FHgJGti7Iw/EPyzMdwTvZH4jkwKfkqg89CmZy1pmn//8qYDSUHJsAgJt4hP48dl8mUPcqEIZKFZ3qT0DNHr8wDPOuvgq0xq+RMBafv/K7ePfEbsf+C5W43npf+BRBN/0f7iZQZvtRUz4X6VjoX4as0lMV85HztwDEVhlPKV8QHfnjLJqcgr2G3/+60Dpl7Zak8JiGdz5VALT4/Vskguk8fnpJvA2Y/B1a9hA67mWeXg+/c1VM1liU14LdPcq6dziVQ8ty9bWWWLHCj3Yr5gVL6rf3E1HuFiO3muXRUsJdRojOh4iaZVthuLwiyykAQeRVDBcfAhvXRkhA8SNrIE+3D37xVXZiyPeyo1LF24v/nu4aJdT5i4lVIVH1Z744NTxG9DUaMd7b7cLqG1KAaIW29YbOUSmLD7+PTdmsXwV1QWWLcQqxX6ppad8XUkYA0OlV6LAtnxoG+UdJzhfeZEsHnkXctM2VcLx6DhMHl7ZTfxVB9nyEqmumufWJzyamcQc2Ch7u7MlYY44TD+H177xzaua+CQlSS53gEmK/bxktKFqJc0XMWDKiaK/ooaQpfFD9yKTZ96AZ6smnwNJu3AcvGEuQv3/MuYWzkAvgcRteukU4mRI9I4yL0D+IIgmZWs++VecXElOEgPZvbRMUfAYRpp2LHvyv1Q95R3dkg3KlBrHLNFhFeaQ/uOw7jAl4LeN6EWDFaiWSY53Qde4b8tzkHC4PMFpHlCy6f4zKRBtet92D8sUR+w2inoTdz2pTyxpi5 |
The following gist is an extract of the article Flask-SQLAlchemy Caching. It allows automated simple cache query and invalidation of cache relations through event among other features.
# pulling one User object
user = User.query.get(1)
I hereby claim:
- I am j178 on github.
- I am j178 (https://keybase.io/j178) on keybase.
- I have a public key ASDwwkUUC1UvGUF2DjZudNwJTDU-SrydNVpaIk4AudKdrQo
To claim this, I am signing this object:
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
#!/usr/bin/env python3 | |
import base64 | |
import random | |
import re | |
import string | |
import requests | |
sess = requests.Session() | |
randstr = lambda len=5: ''.join(random.choice(string.ascii_lowercase) for _ in range(len)) |
NewerOlder