原文:程序人生
上文谈到了像读书一样阅读源码的重要性,今天谈谈如何阅读一份代码。我所谓的一份代码,其范围可能从几千行到数万行,有时甚至可多达数十万行。这些代码作为一个有机体,共同完成某些重要的功能。比如说几个著名的 full fledged web framework,祖师爷 rails,师叔 django 和小师妹 phoenix:
package main | |
import ( | |
"encoding/json" | |
"errors" | |
"database/sql/driver" | |
"fmt" | |
"github.com/jmoiron/sqlx" | |
_ "github.com/lib/pq" | |
"log" |
{ config, lib, pkgs, ...}: | |
with lib; | |
let | |
cfg = config.sec.macchanger; | |
in { | |
options = { | |
sec.macchanger = { | |
enable = mkOption { |
原文:程序人生
上文谈到了像读书一样阅读源码的重要性,今天谈谈如何阅读一份代码。我所谓的一份代码,其范围可能从几千行到数万行,有时甚至可多达数十万行。这些代码作为一个有机体,共同完成某些重要的功能。比如说几个著名的 full fledged web framework,祖师爷 rails,师叔 django 和小师妹 phoenix:
import time | |
import requests | |
import logging | |
import boto3 | |
from botocore.config import Config | |
def send_price_data_to_timestream(write_client): | |
base_url = "https://min-api.cryptocompare.com/data" | |
symbols = "BTC,ETH,REP,DASH" |
PurpleSystemAppPort | |
PurpleSystemEventPort | |
UIASTNotificationCenter | |
com.apple.ABDatabaseDoctor | |
com.apple.AppSSO.service-xpc | |
com.apple.AuthenticationServicesCore.AuthenticationServicesAgent | |
com.apple.CARenderServer | |
com.apple.ClipServices.clipserviced | |
com.apple.CoreAuthentication.daemon | |
com.apple.DeviceAccess.xpc |
# -------------------------------------- | |
# Programmer : github.com/PyMmdrza | |
# pip install tqdm ftplib boto3 pysftp | |
# -------------------------------------- | |
import ftplib | |
import pysftp | |
import boto3 | |
import tarfile | |
import zipfile | |
import os |
<svg width="300" height="300" viewBox="0 0 300 300"> | |
<defs> | |
<filter id="paperEffect"> | |
<feTurbulence | |
type="fractalNoise" | |
baseFrequency="0.04" | |
numOctaves="5" | |
result="noise" | |
/> | |
<feDiffuseLighting |
In the apps config/puma.rb
file:
Change to match your CPU core count
# Check using this on the server => grep -c processor /proc/cpuinfo
workers 4
# Min and Max threads per worker
threads 1, 6
app_dir = File.expand_path('../..', FILE)