Skip to content

Instantly share code, notes, and snippets.

View jas0ncn's full-sized avatar
💭
I may be slow to respond.

Jason Chen jas0ncn

💭
I may be slow to respond.
View GitHub Profile
@jas0ncn
jas0ncn / obtain-certs-aliyun.sh
Created August 10, 2019 18:45
Obtain A Let's Encrypt Cert using acme.sh and deploy with nginx-proxy in Docker
# Apply ALIYUN DNS API TOKEN: https://ak-console.aliyun.com/#/accesskey
export Ali_Key=""
export Ali_Secret=""
# issue cert
~/.acme.sh/acme.sh --issue \
--dns dns_ali \
-d abc.com \
-d "*.abc.com"
@jas0ncn
jas0ncn / obtain-cert.sh
Created November 3, 2018 12:01
Obtain Let's Encrypt Cert with acme.sh and DNSPOD.cn
# Apply DNSPOD.CN API TOKEN: https://www.dnspod.cn/console/user/security
export DP_Id="DNSPOD_ID"
export DP_Key="DNSPOD_KEY"
~/.acme.sh/acme.sh --issue --dns dns_dp -d *.cloud.ijason.cc -d cloud.ijason.cc
@jas0ncn
jas0ncn / Mysql.php
Last active October 11, 2017 13:03
简单的使用 PDO 操作 MySQL 数据库类
<?php
/**
* 简单的使用 PDO 操作 MySQL 数据库类
* 类为静态类,全部静态调用
*/
class Mysql
{
private static $conn;
public static function getInstance () {
@jas0ncn
jas0ncn / dateFormatter.ts
Last active July 14, 2017 11:17
简单的时间格式化
/**
* Full-Date formater
* @author jasonelchen
* @param date 时间
* @param format 格式
*/
export function dateFormatter (date: Date, format: string) {
const o = {
/**
* 完整年份
@jas0ncn
jas0ncn / store.js
Last active April 7, 2017 11:09
Store for wxapp
/**
* Object deepclone
* @param {Object} obj the object need clone
*/
function deepclone (obj) {
if (typeof obj !== 'object' || obj === null) {
return obj
}
const newObj = {}
@jas0ncn
jas0ncn / szushudong-changelog.md
Last active March 19, 2017 06:18
深大树洞微信小程序版本更新日志

ChangeLog

v1.4

  • 【新增】评论匿名功能
  • 【新增】回复评论功能
  • 【优化】列表点评论按钮跳转到详情页
  • 【优化】匿名自动生成随机昵称
  • 【修复】低版本 Android ssl 证书版本不支持无法访问的问题

v1.3.5

@jas0ncn
jas0ncn / sort.js
Created February 13, 2017 12:55
JavaScript sorting algorithm
const arr = [16, 31, 12, 1, 9, 23, 10]
// bubble sort
function bubble (arr) {
for (let i = 0; i < arr.length - 1; i++) {
for (let j = 0; j < arr.length - i - 1; j++) {
if (arr[j] > arr[j+1])
[ arr[j], arr[j+1] ] = [ arr[j+1], arr[j] ]
}
}