This gist is updated daily via cron job and lists stats for npm packages:
- Top 1,000 most depended-upon packages
- Top 1,000 packages with largest number of dependencies
- Top 1,000 packages with highest PageRank score
[ | |
{name: 'Afghanistan', code: 'AF'}, | |
{name: 'Åland Islands', code: 'AX'}, | |
{name: 'Albania', code: 'AL'}, | |
{name: 'Algeria', code: 'DZ'}, | |
{name: 'American Samoa', code: 'AS'}, | |
{name: 'AndorrA', code: 'AD'}, | |
{name: 'Angola', code: 'AO'}, | |
{name: 'Anguilla', code: 'AI'}, | |
{name: 'Antarctica', code: 'AQ'}, |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
func countLabelLines(label: UILabel) -> Int { | |
// Call self.layoutIfNeeded() if your view uses auto layout | |
let myText = label.text! as NSString | |
let rect = CGSize(width: label.bounds.width, height: CGFloat.greatestFiniteMagnitude) | |
let labelSize = myText.boundingRect(with: rect, options: .usesLineFragmentOrigin, attributes: [NSAttributedStringKey.font: label.font], context: nil) | |
return Int(ceil(CGFloat(labelSize.height) / label.font.lineHeight)) | |
} |
const express = require('express') | |
const SamlStrategy = require('passport-saml').Strategy | |
const passport = require('passport') | |
const cookieSession = require('cookie-session') | |
const cookieParser = require('cookie-parser') | |
// Create express instance | |
const app = express() |
Exhaustive list of SPDX (Software Package Data Exchange) licenses: https://spdx.org/licenses/
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { | |
let text = collections[indexPath.row].name | |
let width = UILabel.textWidth(font: titleFont, text: text) | |
return CGSize(width: width + left + right, height: height) | |
} |
Minimal effort image storage, transformation and delivery.