Skip to content

Instantly share code, notes, and snippets.

View JorgeMadson's full-sized avatar

Jorge Madson JorgeMadson

View GitHub Profile
@JorgeMadson
JorgeMadson / data_loading_utils.py
Last active March 27, 2025 14:05 — forked from iyvinjose/data_loading_utils.py
Read large files line by line without loading entire file to memory. Supports files of GB size
def read_lines_from_file_as_data_chunks(file_name, chunk_size, callback, return_whole_chunk=False):
"""
read file line by line regardless of its size
:param file_name: absolute path of file to read
:param chunk_size: size of data to be read at at time
:param callback: callback method, prototype ----> def callback(data, eof, file_name)
:param return_whole_chunk: if True, returns whole chunks instead of line by line
:return: None
"""
@JorgeMadson
JorgeMadson / clean_code.md
Created December 10, 2024 15:23 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@JorgeMadson
JorgeMadson / koa-xmen-api.js
Last active October 18, 2018 23:59 — forked from brianium/koa-xmen-api.js
Koa.js X-MEN Api
var koa = require('koa');
var app = new koa();
var json = require('koa-json');
app.use(json());
app.use(function* (next) {
if (this.method != 'GET') return yield next;
if (!/x-men/.test(this.originalUrl)) return yield next;
using CoreAnimation;
using CoreGraphics;
using Foundation;
using ImageIO;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using UIKit;