Skip to content

Instantly share code, notes, and snippets.

View zmarkan's full-sized avatar

Zan Markan zmarkan

View GitHub Profile
public interface HTTPHelperWrapper {
//your methods go here
void getRequest(Callback callback);
}
public class HTTPHelperWrapperImpl overrides HTTPHelperWrapper {
@Override
public void getRequest(Callback callback){
@zmarkan
zmarkan / clean_arch_samples.java
Created December 17, 2015 10:23
Cooking Clean Architecture sample code, used to present on Codemotion Tel Aviv 2015 (Absolutely non compilable pseudocode samples to show concepts)
// Sample basket data entity
class BasketItem{
int id;
String name;
String imageUrl;
int quantity;
float price;
}

Keybase proof

I hereby claim:

  • I am zmarkan on github.
  • I am zmarkan (https://keybase.io/zmarkan) on keybase.
  • I have a public key whose fingerprint is 8517 B907 4A44 4A05 44B6 5627 A198 C8CF 11DD BA67

To claim this, I am signing this object:

@zmarkan
zmarkan / crash_preventing_crash_android_oreo.kt
Created November 22, 2017 14:53
Code to cause a preventive crash if using Adaptive Icons with Android Oreo, in order to avoid a crash loop
private fun hasDefaultFCMIconInMetadata(context: Context): Boolean {
try {
val appInfo = context.packageManager.getApplicationInfo(
context.packageName, PackageManager.GET_META_DATA)
if (appInfo.metaData != null) {
return appInfo.metaData.getInt(META_DATA_FIREBASE_NOTIFICATION_IMAGE, -1) != -1
}
} catch (_: PackageManager.NameNotFoundException) {
}
@zmarkan
zmarkan / Enable Virtualenv Python3
Last active May 4, 2020 10:14
Python 3 init and use virtualenv
# Run in empty dir:
python3 -m venv .env
# Enable venv
. .env/bin/activate && python -V
@zmarkan
zmarkan / Bookmarklet - Compare GitHub commit with master branch.md
Last active June 3, 2023 13:17
Bookmarklet: Compare GitHub commit with Master

Usage

  1. Create a new bookmark in your bookmarks bar with the following contents:
javascript: (function(){
            let location = window.location.href;
            let validatorRegex = /https:\/\/github.com\/[a-z][a-zA-z0-9\-\_]+\/[a-z][a-zA-z0-9\-\_]+\/commit\/[a-f0-9]+/g;
            let match = location.match(validatorRegex);
            if(!match){
@zmarkan
zmarkan / ci_ffs.sh
Last active December 3, 2020 11:29
Commit to branch, push, and trigger a new CI build. Useful when debugging CI/CD configurations.
# Add this to your BASH or ZSH profile.
# Execute with ciffs
alias ciffs='branchname=`git rev-parse --abbrev-ref HEAD` && git commit -am "CI FFS" && git push origin $branchname'
@zmarkan
zmarkan / config.yml
Last active March 19, 2021 09:39 — forked from hacktivist123/config.yml
Cloud Foundry CircleCI
version: '2.1'
jobs:
install-login-deploy:
docker:
- image: cimg/base:stable
steps:
- checkout
- run:
name: Install Cloud Foundry CLI