When evaluating this code in an org-mode document:
const sq = x => x * x;
const cube = x => sq(sq(x));
return cube(4);
brew install pandoc | |
brew tap homebrew/cask | |
brew install --cask basictex | |
eval "$(/usr/libexec/path_helper)" | |
# Update $PATH to include `/usr/local/texlive/2022basic/bin/universal-darwin` | |
sudo tlmgr update --self | |
sudo tlmgr install texliveonfly | |
sudo tlmgr install xelatex | |
sudo tlmgr install adjustbox | |
sudo tlmgr install tcolorbox |
docker ps -f status=exited | grep "\-cache-" | awk '{print $1}' | xargs docker rm |
// file: index.js | |
var _ = require("lodash"); | |
var express = require("express"); | |
var bodyParser = require("body-parser"); | |
var jwt = require('jsonwebtoken'); | |
var passport = require("passport"); | |
var passportJWT = require("passport-jwt"); |
// 检测浏览器的 User Agent 应该是非常简单的事情 | |
// 微信在 Android 下的 User Agent | |
mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/5.0.1.352 | |
// 微信在 iPhone 下的 User Agent | |
mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0 | |
// 通过javascript判断 | |
// 很容易看出来,微信的 User Agent 都有‘micromessenger’字符串标示,我们判断是否含有这些字符串就OK了 | |
function isWeixinBrowser(){ |
# Snippet setting git branch and git dirty helper | |
# Commit at the end kept from original snippet, I added the rev-parse stuff and the proper redirection. | |
set fish_git_dirty_color red | |
set fish_git_clean_color brown | |
function parse_git_dirty | |
if test (git status 2> /dev/null ^&1 | tail -n1) != "nothing to commit (working directory clean)" | |
echo (set_color $fish_git_dirty_color) | |
else |
# If you need to add a created_at field in your database | |
# that inserts "now()" when the insert statement is run, you | |
# can use the following script. | |
# It uses timestamps, but removes the "on update" for the | |
# created_at column, but keeps it on the updated_at (which | |
# needs to update at every change). | |
# | |
# got this snippet here: | |
# http://bugs.mysql.com/bug.php?id=27645 | |
# (search for: "[7 Oct 2009 4:25] Diego Medina") |