Skip to content

Instantly share code, notes, and snippets.

@wulie88
wulie88 / Draw.js
Last active September 26, 2020 00:57
微信小程序canvas绘制胶水代码,可用于自绘UI并截图分享,取自wxml-to-canvas组件,修复了图片圆角bug,加入了示例代码
/*
微信小程序canvas绘制胶水代码
*/
class Draw {
constructor(canvas, context) {
this.canvas = canvas
this.ctx = context
}
@wulie88
wulie88 / DatabaseManager.swift
Last active August 12, 2020 03:58
GRDB Examples
// https://github.com/noahsark769/OrderedTODO/blob/master/OrderedTODO/DatabaseManager.swift
//
// DatabaseManager.swift
// OrderedTODO
//
// Created by Noah Gilmore on 12/26/19.
// Copyright © 2019 Noah Gilmore. All rights reserved.
//
import Foundation
import GRDB
const path = require('path')
const fsPromises = require('fs').promises
const { execSync } = require('child_process');
const root = '.'
async function main() {
const dirs = await fsPromises.readdir(root)
for (let i = 0; i < dirs.length; i ++) {
const name = dirs[i], dir = path.join(root, name)
@wulie88
wulie88 / init-dev-env-on-macOS.sh
Last active May 13, 2020 08:12
初始化macOS开发环境
## 使用以下命令替换 gems 默认源
# 添加 TUNA 源并移除默认源
gem sources --add https://mirrors.tuna.tsinghua.edu.cn/rubygems/ --remove https://rubygems.org/
# 列出已有源
gem sources -l
# 应该只有 TUNA 一个
## home brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# brew 程序本身,Homebrew/Linuxbrew 相同
@wulie88
wulie88 / output_apple_developer_devices.js
Created August 19, 2016 03:36
通过jQuery在页面上找到name和device_id,实现从苹果开发者中心导出已经添加的设备ID,然后选择批量导入就可以了。
// 在设备列表的控制台上输入
var s = ''; $('tr.jqgrow').each(function() { var $s = $(this), n = $s.find('td:nth-child(2)').text(), t = $s.find('td:nth-child(4)').text(); as.push({n:n, t:t}); s += n + "\t" + t + "\n"});
// 这就是我们想要的了
s
@wulie88
wulie88 / dnspodsh.sh
Last active August 29, 2015 13:56 — forked from zrong/dnspodsh.sh
#!/bin/bash
##############################
# dnspodsh v0.3
# 基于dnspod api构架的bash ddns客户端
# 作者:zrong(zengrong.net)
# 详细介绍:http://zengrong.net/post/1524.htm
# 创建日期:2012-02-13
# 更新日期:2014-02-10 加入wget支持
##############################