Skip to content

Instantly share code, notes, and snippets.

@zmarkan
zmarkan / config.yml
Last active Mar 19, 2021 — forked from hacktivist123/config.yml
Cloud Foundry CircleCI
View config.yml
version: '2.1'
jobs:
install-login-deploy:
docker:
- image: cimg/base:stable
steps:
- checkout
- run:
name: Install Cloud Foundry CLI
@zmarkan
zmarkan / ci_ffs.sh
Last active Dec 3, 2020
Commit to branch, push, and trigger a new CI build. Useful when debugging CI/CD configurations.
View ci_ffs.sh
# 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 / Bookmarklet - Compare GitHub commit with master branch.md
Last active May 29, 2020
Bookmarklet: Compare GitHub commit with Master
View Bookmarklet - Compare GitHub commit with master branch.md

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 / Enable Virtualenv Python3
Last active May 4, 2020
Python 3 init and use virtualenv
View Enable Virtualenv Python3
# Run in empty dir:
python3 -m venv .env
# Enable venv
. .env/bin/activate && python -V
@zmarkan
zmarkan / crash_preventing_crash_android_oreo.kt
Created Nov 22, 2017
Code to cause a preventive crash if using Adaptive Icons with Android Oreo, in order to avoid a crash loop
View crash_preventing_crash_android_oreo.kt
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) {
}
View keybase.md

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 / clean_arch_samples.java
Created Dec 17, 2015
Cooking Clean Architecture sample code, used to present on Codemotion Tel Aviv 2015 (Absolutely non compilable pseudocode samples to show concepts)
View clean_arch_samples.java
// Sample basket data entity
class BasketItem{
int id;
String name;
String imageUrl;
int quantity;
float price;
}
View HttpHelperWrapper.java
public interface HTTPHelperWrapper {
//your methods go here
void getRequest(Callback callback);
}
public class HTTPHelperWrapperImpl overrides HTTPHelperWrapper {
@Override
public void getRequest(Callback callback){