Skip to content

Instantly share code, notes, and snippets.

View czfadmin's full-sized avatar
🍏
Cool

Leon czfadmin

🍏
Cool
View GitHub Profile
@czfadmin
czfadmin / curl.md
Created June 14, 2024 07:00 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@czfadmin
czfadmin / index.ts
Last active April 8, 2024 14:39
honojs+socket.io
import { serve } from '@hono/node-server';
import { Hono } from 'hono';
import { Server } from 'socket.io';
import { Server as HttpServer } from 'http';
const app = new Hono();
app.get('/', (c) => {
return c.text('Hello Hono!');
});
@czfadmin
czfadmin / docker-registry-mirrors.md
Created March 6, 2024 08:40 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@czfadmin
czfadmin / button_field_example.py
Created December 22, 2018 08:53 — forked from doobeh/button_field_example.py
WTForms ButtonField Example
from flask import Flask, render_template_string
from flask_wtf import Form
from wtforms import StringField
from wtforms.widgets import html_params, HTMLString
app = Flask(__name__)
app.secret_key = 'SHH!'
class ButtonWidget(object):
private AlertDialog genrateAlertDialogHelper(){
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage("是否重置相关IP配置").setPositiveButton(
"确定", new DialogInterface.OnClickListener() {
@SuppressLint("CommitPrefEdits")
@Override
public void onClick(DialogInterface dialog, int which) {
if (editor == null) {
editor = preferences.edit();
}
@czfadmin
czfadmin / DataManager.java
Last active December 13, 2021 21:39
Authenticator
Authenticator authenticator= new Authenticator() {
@Override
public Request authenticate(Route route, Response response) throws IOException {
String credential = Credentials.basic("*******", "******");
return response.request().newBuilder().header("Authorization", credential).build();
}
};