Skip to content

Instantly share code, notes, and snippets.

View michaelNgiri's full-sized avatar
🏠
Working from home

Ngiri Michael michaelNgiri

🏠
Working from home
View GitHub Profile
@Adem68
Adem68 / flutter-project-line.md
Last active April 15, 2025 15:55
How many lines does your Flutter project have?
  • Open terminal and go to your project's lib folder. After that run the command below.
  • find . -name '*.dart' ! -name '*.g.dart' ! -name '*.freezed.dart' ! -name '*.gr.dart' ! -name '*.gen.dart' | xargs wc -l

Thanks @AcetylsalicylicAcid for excluding generated files.

@michaelNgiri
michaelNgiri / paginated.js
Created January 16, 2020 20:35 — forked from jstott/paginated.js
lodash paginated items
function getPaginatedItems(items, page, pageSize) {
var pg = page || 1,
pgSize = pageSize || 100,
offset = (pg - 1) * pgSize,
pagedItems = _.drop(items, offset).slice(0, pgSize);
return {
page: pg,
pageSize: pgSize,
total: items.length,
total_pages: Math.ceil(items.length / pgSize),