Skip to content

Instantly share code, notes, and snippets.

View amrfarid140's full-sized avatar

Amr Yousef amrfarid140

View GitHub Profile
@bryansills
bryansills / WhiteBalanceAdjuster.kt
Last active July 25, 2021 11:31
Auto White Balance Adjustment
import android.graphics.Bitmap
import android.graphics.Color
import androidx.annotation.ColorInt
import com.curiouscreature.kotlin.math.Float3
import com.curiouscreature.kotlin.math.Mat3
import com.curiouscreature.kotlin.math.saturate
import com.curiouscreature.kotlin.math.transpose
import kotlin.math.pow
@sertalpbilal
sertalpbilal / FPL_Data_Download.md
Last active June 30, 2021 21:00
Download FPL API data

You can save the python file to your machine, replace your team ID and run

python download_fpl_api.py

This will create a directory data and will include all files in JSON format.

@mayoff
mayoff / SteppingSubscriber.swift
Created December 18, 2019 06:50
Custom Combine operator for stepping a publisher's signals through function
// See https://stackoverflow.com/q/59367202/77567
import Combine
import Foundation
extension Publisher {
func step(with stepper: @escaping (SteppingSubscriber<Output, Failure>.Event) -> ()) -> AnyCancellable {
let subscriber = SteppingSubscriber<Output, Failure>(stepper: stepper)
self.subscribe(subscriber)
return .init(subscriber)
@luanmm
luanmm / AndroidManifest.xml
Last active December 1, 2023 20:01
Android WorkManager dependency injection (with Dagger)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
...>
<application
...>
...
import android.app.Activity;
import android.support.annotation.Nullable;
import android.support.test.runner.lifecycle.ActivityLifecycleMonitorRegistry;
import java.util.Collection;
import static android.support.test.InstrumentationRegistry.getInstrumentation;
import static android.support.test.runner.lifecycle.Stage.RESUMED;
public final class CurrentActivityUtil {
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active July 27, 2024 11:07
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real