Skip to content

Instantly share code, notes, and snippets.

View waylybaye's full-sized avatar

Baye waylybaye

  • Indie Developer
  • China
View GitHub Profile
@waylybaye
waylybaye / index.js
Last active March 10, 2022 11:09
Send Notification using Telegram when new IAP is purchased
const functions = require('firebase-functions');
const TelegramBot = require('node-telegram-bot-api');
const token = "***"
const chatID = 1024 // your telegram id, you must first send a message to your bot
exports.notifyIAP = functions.analytics.event('in_app_purchase').onLog((event) => {
const purchaseValue = event.valueInUSD;
if (purchaseValue > 0) {
const bot = new TelegramBot(token, {polling: false});
@waylybaye
waylybaye / Measure.swift
Last active March 12, 2024 14:09
SwiftUI view render performance Indicator
// Created by Baye Wayly on 2020/3/13.
// Copyright © 2020 Baye. All rights reserved.
import SwiftUI
struct Measure<Content: View>: View {
@State var cost: TimeInterval = 0
var content: Content
init(@ViewBuilder builder: () -> Content) {
@waylybaye
waylybaye / shell
Last active December 15, 2015 03:29
migrate old django `url` templatetag to new style Django 1.5 url
find . -name "*.html" -exec sed -i "" -e 's/{% *url *\([a-zA-Z0-9_:]*\)/{% url "\1"/g' '{}' \;
@waylybaye
waylybaye / gist:1178267
Created August 29, 2011 12:11
vimwiki header demo
// .vimrc 文件
"Vimwiki settings
let g:vimwiki_use_mouse = 1
let g:vimwiki_list = [{'path': '~/Dropbox/note',
\ 'path_html': '~/Dropbox/note/html',
\ 'html_header': '~/Dropbox/note/html/header.tpl',
\ 'html_footer': '~/Dropbox/note/html/footer.tpl'}]
let g:vimwiki_camel_case = 0