Skip to content

Instantly share code, notes, and snippets.

View pluveto's full-sized avatar
💦
I may be slow to respond.

Zijing Zhang pluveto

💦
I may be slow to respond.
View GitHub Profile
@pluveto
pluveto / timer.ts
Created December 10, 2023 07:12
Typescript controllable Timer implementation
import { Logger } from './logger'
export class Timer {
running?: NodeJS.Timeout
timeout: number
callback: () => void
logger?: Logger
constructor(timeout: number, callback: () => void, logger?: Logger) {
this.timeout = timeout
import abc
class ConfigSource(metaclass=abc.ABCMeta):
@abc.abstractmethod
def sync(self, dest: str) -> bool:
return NotImplemented
class ObtuseAngle:
#!/bin/bash
# README: A more updated version is on the comments by (ashmna)[https://gist.github.com/ashmna]
# See at: https://gist.github.com/allangarcia/938b052a7d55d1652052e4259364260b?permalink_comment_id=4265898#gistcomment-4265898
# this is for tools required
brew update
brew install ninja
brew install cmake
import fs from 'fs';
import stream from 'stream';
interface Exportable {
export(): Promise<stream.Readable>;
}
interface CloudExportable {
exportCloud(provider: CloudProvider): Promise<void>;
}
<?php
require_once('../lists/admin/PHPMailer/PHPMailerAutoload.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
$body = file_get_contents('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP(); // telling the class to use SMTP
@pluveto
pluveto / mq.go
Created November 7, 2021 13:09
Go NSQ Encapsulation and Usage
package mq
import (
"encoding/json"
"fmt"
"time"
"github.com/nsqio/go-nsq"
"go.uber.org/zap"
)
@pluveto
pluveto / cr.sh
Created July 12, 2021 05:02
Compile and run
#!/bin/bash
if [ ! -n "$1" ] ;then
echo -e "\033[31mMissing source file name!\033[0m"
exit 1
fi
# echo -e "\033[33m"`date`"\033[0m"
@pluveto
pluveto / csharp-json-config-helper.cs
Created February 28, 2020 16:37
Json config manager / helper for c#
/// <summary>
/// 配置文件对象管理器
/// </summary>
public class ConfigManager<T>
{
/// <summary>
/// 缓存到内存的配置文件
/// </summary>
public string FileName { get; private set; }

html:

<nz-form-item>
    <ng-container *ngIf="to.label && to.hideLabel !== true">
        <nz-form-label [nzRequired]="to.required && to.hideRequiredMarker !== true" [nzFor]="id">
            {{ to.label }}
        </nz-form-label>
        
        <nz-select
        [class.ng-dirty]="showError"