1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv
to manually rebuild the font cache
### WARNING: READ CAREFULLY BEFORE ATTEMPTING ### | |
# | |
# Officially, this is not recommended. YMMV | |
# https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/ | |
# | |
# This mostly works if you are on 64bit. You are on your own if you are on 32bit or mixed 64/32bit | |
# | |
# Credit to anfractuosity and fgimenezm for figuring out additional details for kernels | |
# |
1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv
to manually rebuild the font cache
# To connect this middleware.rb file to your sinatra app | |
# add 'use JWTAuthorization' as one of your first lines in | |
# your Application class. | |
# e.g. | |
# require 'middlewares.rb' | |
# class Application < Sinatra::Base | |
# use JWTAuthorization | |
# ... | |
# end |
# | |
# This first version should work on Mac OS X and Linux, but it spawns a process | |
# | |
# http://stackoverflow.com/questions/7220896/ | |
# https://github.com/rdp/os/blob/master/lib/os.rb#L127 | |
# http://www.ruby-doc.org/core-2.0/Process.html | |
# | |
# the real memory (resident set) size of the process (in 1_024 byte units). | |
def Process.rss() `ps -o rss= -p #{Process.pid}`.chomp.to_i ; end |
class MyResource | |
include HTTParty | |
debug_output $stdout # <= will spit out all request details to the console | |
#... | |
end |
#总体上分成三个部分构成:基本配置、events配置、HTTP配置,以下为配置详情 | |
#------------------------基本配置------------------------- | |
#user nobody; #配置worker进程运行用户 | |
worker_processes 4; #配置工作进程数目,根据硬件调整,通常等于CPU数量或者2倍于CPU数量 | |
#error_log logs/error.log; #配置全局错误日志及类型,[debug | info | notice | warn | error | crit],默认是error | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; #配置进程pid文件 |
require 'bond' | |
Bond.start | |
# For users using a pure ruby readline | |
Bond.start :readline => :ruby |
git log --numstat --pretty="%H" <HashStart>..<HashEnd> | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d,-%d\n",plus,minus)}'\n |
In your Python package, you have:
__init__.py
that designates this as a Python packagemodule_a.py
, containing a function action_a()
that references an attribute (like a function or variable) in module_b.py
, andmodule_b.py
, containing a function action_b()
that references an attribute (like a function or variable) in module_a.py
.This situation can introduce a circular import error: module_a
attempts to import module_b
, but can't, because module_b
needs to import module_a
, which is in the process of being interpreted.
But, sometimes Python is magic, and code that looks like it should cause this circular import error works just fine!
function unorderArr(arr){ | |
let carr = arr.concat(); | |
carr.sort(function(x,y){ | |
return 0.5-Math.random() | |
}) | |
return carr | |
} |