Skip to content

Instantly share code, notes, and snippets.

View BadReese's full-sized avatar
🏠
Working from home

BadReese BadReese

🏠
Working from home
  • 厦门格式网络
  • 厦门
View GitHub Profile
@BadReese
BadReese / page_turn.dart
Created April 18, 2023 10:51 — forked from slightfoot/page_turn.dart
Page Turn Effect - By Simon Lightfoot. Replicating this behaviour. https://www.youtube.com/watch?v=JqvtZwIJMLo
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@BadReese
BadReese / wechat.miniprograme.location.js
Created November 1, 2019 02:58
[微信小程序获取定位权限] #weixin
if (filter == DishUtils.FILTER_DISTANCE) {
// 距离排序 申请权限
var context = this
// 检查权限
wx.getSetting({
success: (res) => {
if ('scope.userLocation' in res.authSetting) {
// 表示申请过权限
if (res.authSetting["scope.userLocation"] != true) {
wx.showModal({
@BadReese
BadReese / get_zero_timestamp.py
Last active August 28, 2019 04:04
[python tips] get_zero_timestamp/Peewee Mysql分组统计查询 #python
def get_zero_timestamp(self):
cur_timestamp = time.time()
cur_time = time.localtime(cur_timestamp)
zero_time_stamp = cur_timestamp - (
cur_time.tm_sec + 60 * cur_time.tm_min + 3600 * cur_time.tm_hour)
return zero_time_stamp