参考JS中微信小程序自定义底部弹出框, 整理而成.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (average x y) | |
(/ (+ x y) 2)) | |
(define (improve guess x) | |
(average guess (/ x guess))) | |
(define (goodenough? guess x) | |
(< (/ (abs (- guess | |
(improve guess x))) | |
guess) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias rebase_upstream="export CURRENT_BRANCH_NAME=`git branch | grep \* | cut -d ' ' -f2` && git checkout master && git pull upstream master && git checkout $CURRENT_BRANCH_NAME && git rebase master" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find -name "*" -print0 | xargs -0 dos2unix | |
// TODO: the binary files will raise warning without convert. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
WXAPP_TEST_SITEUSER = os.getenv('WXAPP_TEST_SITEUSER') # return None if not exist |
It is the third of exercise 1 in Yet Another Scheme Tutorial. The answer is difficult for a beginner to understand. Here is an easier answer for this exercise on StackOverflow.
Thanks for the author of YAST and the answer of the question.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE "area_genericimage" | |
SET "sort" = | |
CASE WHEN "id" = 40964 THEN 1 | |
WHEN "id" = 40965 THEN 2 | |
END | |
WHERE "area_genericimage"."id" in (40964, 40965) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copy a file with time as tail. | |
# Reference: https://i.linuxtoy.org/docs/guide/ch15s05.html | |
sudo cp $1 $1_`date +%y%m%d_%H:%M:%S` |
There are two kinds of date and time objects: “naive” and “aware”.
An aware object has sufficient knowledge of applicable algorithmic and political time adjustments, such as time zone and daylight saving time information, to locate itself relative to other aware objects. An aware object is used to represent a specific moment in time that is not open to interpretation.
OlderNewer